C - Operators - Discussion

You Are Here :: Home > C > Operators - Discussion

 



Q.

What will be output if you will compile and execute the following c code?

#include
int main(){
register int i,x;
scanf("%d",&i);
x=++i + ++i + ++i;
printf("%d",x);
return 0;
}

A. 17 B. 18
C. 19 D. Compiler error

Answer: Option D
Explaination:

 


In c register variable stores in CPU it doesn't store in RAM. So register variable have not any memory address. So it is illegal to write &a.



Discussion

Your Comments Goes here...
NameDiscussion