Question: Accept two numbers and find their sum and difference. If the sum is more than the difference, display the sum otherwise display the difference. Odd
Accept two numbers and find their sum and difference. If the sum is more than the difference, display the sum otherwise display the difference. Odd & Even Number program using loop (repeat 5 time)
#include using namespace std;
int main() { int n; for(int i = 0;i < 5;i++) { cin >> n; if(n%2 == 1) cout << "Odd "; else cout << "Even "; } return 0; }
-------------using C++-------------------
Modify the program to use these functions void informUser(); void checkSum(int); int add(int,int);//return A VALUE void enterNumbers(int&,int&);
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
