Skip to content
Related Articles

Related Articles

ISRO | ISRO CS 2014 | Question 3
  • Last Updated : 07 May, 2018

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

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up
Recommended Articles
Page :