Write a program to take two numbers as input and print their difference if the first number is greater than the second number otherwise print their sum.

 

Write a program to take two numbers as input and print their difference if the first number is greater than the second number otherwise print their sum. 






#include <iostream>
using namespace std;
int main()
{
    int N1N2subadd;
    cin >> N1;
    cin >> N2;

    if (N1 > N2)
    {
        sub = N1 - N2;
        cout << sub;
    }
    else
        add = N1 + N2;
    cout << add;
}




    


Click on the above button to download the code.



Post a Comment

If you have furthur QUERIES please let us know

Previous Post Next Post