#include <stdio.h>
#define sqr(x) (x*x)
int main()
{
int x=2;
printf("value of x=%d",sqr(x+1));
}

What is the value of x?

Answer Posted / gg

Ans : 5

I agree with Divakar ans & similar answers.

sqr(x+1)=x+1*x+1=2+1*2+1=5, but not 2*2+1

Is This Answer Correct ?    17 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Differentiate fundamental data types and derived data types in C.

621


Once I have used freopen, how can I get the original stdout (or stdin) back?

631


which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above

1139


Why c is procedure oriented?

576


What is malloc calloc and realloc in c?

673






How can I send mail from within a c program?

583


What is %g in c?

624


Is c pass by value or reference?

598


What is the difference between new and malloc functions?

583


What are header files and what are its uses in C programming?

640


What is the difference between the local variable and global variable in c?

534


Explain what is the difference between text files and binary files?

622


Explain how do you print only part of a string?

652


Draw a diagram showing how the operating system relates to users, application programs, and the computer hardware ?

2124


Who is the main contributor in designing the c language after dennis ritchie?

555