News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

what answer is right in this case :)

Started by karadev, September 04, 2018, 02:11:39 PM

Previous topic - Next topic

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


Miguel Gimenez

The value of b is different, anyway this is OT here

stahta01

#3
Edit: Where are the rules?
Link to rules http://forums.next.codeblocks.org/index.php/topic,9996.0.html

**** The link at bottom of post no longer links to the rules!!!!

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

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!!!!

Fixed, thanks for reporting !