- 1
Write a programmer in c++ to Calculate the difference 10 and 12
Difference
5 ответов
+ 4
How to write programmer 😐?
cout << 12 << "-" << 10 << "=" << 2;
Maybe...LoL
+ 4
cout << 12-10;
+ 3
difference of two succesive numbers is always 2
|n - (n+2)| = |n-n-2| = | -2| = 2
or |n - (n-2)| = |n-n+2| = |2| = 2
So the algorithm should look like this:
give user input(number)
print(number+" - "+(number+2)+" = "+(number- (number+2)))
+ 1
return 2;
There, solved it :D
However, that "write a PROGRAMMER" task might be a lot more difficult.. :)
Joking aside, you shouldn't come here and expect other people to do your homework... Write some code, post it here, and ask questions when you are stumped.
0
Difference two number