Problem : 15


#include <stdio.h>
#define F(a,b) (a*b) / (a-b)

int main ()
{
    int a = 20, b = 10;
    printf("%d\n", F(a-1, b+2));
    return 0;
}


// What's the output ? [Do not execute / run]
// Source : http://www.youngprogrammer.com/
Advertisements

2 thoughts on “Problem : 15

  1. @md. ashiqul mostofa
    u r having a – b = 11
    becoz it’s the correct ans
    what do u think the value was supposed to be ?
    lets make it clr
    suppose line : 2 is written as,
    #define F(A,B) A-B

    Now, A = a – 1
    and B = b + 2
    A – B = a – 1 – b + 2 = 20 – 1 – 10 + 2 = 11

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s