- Code: Select all
#include "stdafx.h"
#include <iostream>
using namespace std;
int main ()
{
double first;
double second;
double difference;
double divide;
double add;
double multiply;
char choice;
cout << "The Integer Statstics Project:)!! \n";
cout << "Please Enter your first Integer: \n";
cin >> first;
cout << "Please Enter your second Integer: \n" ;
cin >> second;
(first == second)? cout << first <<" "<< "is equal to "<< " "<< second : cout <<"They are not equal "<<endl;
(first>second)? cout << first << " "<<"is greater than "<<" "<< second <<"\n"<< second<<" " << "is less than" <<" "<<first : cout <<second <<"is greater than "<<first<<"\n"<<first <<"is less than"<<second<< endl;
(first>=second)? cout << first << " "<<"is greater than or equal to"<<" "<< second <<"\n"<< second<<" " << "is not less than" <<" "<<first : cout <<second <<"is greater than or equal to"<<first<<"\n"<<first <<"is less than or equal to"<<second<< endl;
cout << "\n choose what do you want to do with two integers (+,-,*,/): \n";
cin >> choice;
difference=first-second;
divide=first/second;
add=first+second;
multiply=first*second;
if (choice=='+')cout << add;
else if (choice =='-') cout << "The difference is"<<" "<<difference;
else if (choice == '*') cout << multiply;
else if (choice == '/') cout << "The division result is" << " "<<divide;
char f;
cin >> f;
return 0;
}
sorry for mistakes i am just learning this thing
