Open In App

ISRO | ISRO CS 2014 | Question 3

What is the output of the following C program?




#include<stdio.h>
#define SQR(x) (x*x)
int main()
{
    int a;
    int b=4;
    a=SQR(b+2);
    printf("%d\n",a);
    return 0;
}

(A) 14
(B) 36
(C) 18
(D) 20

Answer: (A)
Explanation: #define SQR(x) (x*x)
a = SQR(b+2);
a = (b + 2*b + 2) = (4 + 2*4 + 2) = 14

So, option (A) is correct.
Quiz of this Question

Article Tags :