Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: karadev on September 04, 2018, 02:11:39 pm
-
#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;
}
-
Both are correct. What have i won?
-
The value of b is different, anyway this is OT here
-
Edit: Where are the rules?
Link to rules http://forums.codeblocks.org/index.php/topic,9996.0.html (http://forums.codeblocks.org/index.php/topic,9996.0.html)
**** The link at bottom of post no longer links to the rules!!!!
Tim S.
-
Edit: Where are the rules?
<...>
**** The link at bottom of post no longer links to the rules!!!!
Fixed, thanks for reporting !