Friday, 26.04.2024, 19:15
Welcome Guest | RSS
Site menu
Login form
Section categories
Search
Calendar
«  June 2011  »
SuMoTuWeThFrSa
   1234
567891011
12131415161718
19202122232425
2627282930
Entries archive
Our poll
Rate my site
Total of answers: 6
Statistics

Total online: 1
Guests: 1
Users: 0

Main » 2011 » June » 10 » if example
18:03
if example
#include <iostream>
#include <string>
#include <sstream>

using namespace std;

int main()
{
    int value1, value2, m;
    string b="Enter a number: ";
    string a;
cout<<b;
getline(cin,a);
stringstream(a)>>value1;
cout<<b;
getline(cin,a);
stringstream(a)>>value2;
m=value1*value2;
if (m>50)
cout<<"m > 50 and is equal to "<<m;
else if (m<50)
cout<<"m < 50 and is equal to "<<m;
else
cout<<"m = 50";cin.get();
return 0;
}

Category: C++ programs | Views: 531 | Added by: H_Imirzyan | Tags: example, if | Rating: 0.0/0
Total comments: 0
Name *:
Email *:
Code *: