problem answer please

You have two numbers, if these two numbers are equal, print the value of any of these two numbers. If these two are not equal, get the sum of these two values and print the sum.
You have two numbers, if these two numbers are equal, print the value of any of these two numbers. If these two are not equal, get the sum of these two values and print the sum.


1
2
3
4
5
6
7
8
9
if(a == b)
{
    if(rand() % 100 >= 50) cout << a; else cout << b;
}
else
{
    double sum = a + b;
    cout << sum;
}
Topic archived. No new replies allowed.