User forums > Using Code::Blocks
what answer is right in this case :)
(1/1)
karadev:
#include <iostream>
using namespace std;
int main()
{
// all values are size type int
int a = 3522;
int b = 52355;
int c = 23;
int d = 2336;
int e = 501;
int f = 23432;
int g = 6743;
int h = 3;
long result = 0;
long result2 = 0;
result2 = (3522+52353)*23 - (2336*501 + 23432 - 6743)*3;
// console output result2 = -2275950
result = ((a+b)*c) - (((d*e)+(f-g))*h);
// console output result = -2275904
cout << result2 << "\n";
cout << result << "\n";
cout << "press ENTER key for end";
getchar();
return 0;
}
sodev:
Both are correct. What have i won?
Miguel Gimenez:
The value of b is different, anyway this is OT here
stahta01:
Edit: Where are the rules?
Link to rules http://forums.codeblocks.org/index.php/topic,9996.0.html
**** The link at bottom of post no longer links to the rules!!!!
Tim S.
Jenna:
--- Quote from: stahta01 on September 04, 2018, 05:07:27 pm ---Edit: Where are the rules?
<...>
**** The link at bottom of post no longer links to the rules!!!!
--- End quote ---
Fixed, thanks for reporting !
Navigation
[0] Message Index
Go to full version