Wednesday, 21 February 2018

C Interview question.


What is the output ?
void main()
{
Int a=3,b=5;
printf("%d",++(a*b+1));
}

---------------------------------------------------------------------------
Output:
compile time error
Lvalue required.

Reason:
For the increment operator the operands should be always a variable,
Operands cannot be constant or  expression.

No comments:

Post a Comment

C interview question 8

What will be the output of the given code? #include <stdio.h> int main(void) { float a = 3.14; printf("%f",a%3); ...