#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 / divakar
ouput :value of x=5
bcoz sqr(x+1)=(x+1*x+1) if u substitute x=2 u will get 5
since '*' is having more priority than '+'
at the of prog if u add prinf("%d",x); u will get 2
bcoz x value is not changed
Is This Answer Correct ? | 32 Yes | 4 No |
Post New Answer View All Answers
Write a simple code fragment that will check if a number is positive or negative.
What is the difference between malloc calloc and realloc in c?
If I have a char * variable pointing to the name of a function ..
How can I remove the trailing spaces from a string?
What are compound statements?
What is a null pointer assignment error? What are bus errors, memory faults, and core dumps?
What is build process in c?
Explain the use of 'auto' keyword
What is difference between arrays and pointers?
What is omp_num_threads?
What are the preprocessor categories?
What is keyword in c?
What is preprocessor with example?
if p is a string contained in a string?
Given below are three different ways to print the character for ASCII code 88. Which is the correct way1) char c = 88; cout << c << " ";2) cout.put(88);3) cout << char(88) << " "; a) 1 b) 2 c) 3 d) constant