main()

{

int i = 3;

for (;i++=0;) printf(“%d”,i);

}



main() { int i = 3; for (;i++=0;) printf(“%d”,i); }..

Answer / susie

Answer :

Compiler Error: Lvalue required.

Explanation:

As we know that increment operators return rvalues and
hence it cannot appear on the left hand side of an
assignment operation.

Is This Answer Correct ?    14 Yes 1 No

Post New Answer

More C Code Interview Questions

How will you print % character? a. printf(“\%”) b. printf(“\\%”) c. printf(“%%”) d. printf(“\%%”)

4 Answers   HCL,


#include"math.h" void main() { printf("Hi everybody"); } if <stdio.h> will be included then this program will must compile, but as we know that when we include a header file in "" then any system defined function find its defination from all the directrives. So is this code of segment will compile? If no then why?

2 Answers  


void main () { int x = 10; printf ("x = %d, y = %d", x,--x++); } a. 10, 10 b. 10, 9 c. 10, 11 d. none of the above

2 Answers   HCL,


#define FALSE -1 #define TRUE 1 #define NULL 0 main() { if(NULL) puts("NULL"); else if(FALSE) puts("TRUE"); else puts("FALSE"); }

1 Answers  


#include<stdio.h> int main() { int a=3,post,pre; post= a++ * a++ * a++; a=3; pre= ++a * ++a * ++a; printf("post=%d pre=%d",post,pre); return 0; }

3 Answers  






write a program to count the number the same (letter/character foreg: 's') in a given sentence.

2 Answers  


Sir... please give some important coding questions asked by product companies..

0 Answers  


Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it.

2 Answers   Wipro,


Finding a number which was log of base 2

1 Answers   NetApp,


#define f(g,g2) g##g2 main() { int var12=100; printf("%d",f(var,12)); }

3 Answers  


What is the output for the program given below typedef enum errorType{warning, error, exception,}error; main() { error g1; g1=1; printf("%d",g1); }

1 Answers  


Is this code legal? int *ptr; ptr = (int *) 0x400;

1 Answers  


Categories