what is op?
for(c=0;c=1000;c++)
printf("%c",c);

Answers were Sorted based on User's Feedback



what is op? for(c=0;c=1000;c++) printf("%c",c);..

Answer / guest

infinite loop

Is This Answer Correct ?    29 Yes 7 No

what is op? for(c=0;c=1000;c++) printf("%c",c);..

Answer / vikas chauhan

It will print funny caharcter ( ascii equivalent of 1000
trucated char) infinitely

Is This Answer Correct ?    14 Yes 3 No

what is op? for(c=0;c=1000;c++) printf("%c",c);..

Answer / karthik

i executed this program it went on displaying funny
characters indefinite loop

Is This Answer Correct ?    8 Yes 1 No

what is op? for(c=0;c=1000;c++) printf("%c",c);..

Answer / ksprasad

It will go for infinite loop.
But in each iteration, c is assigned with the value 1000.
So each time it will print a character of ascii=1000.

Is This Answer Correct ?    6 Yes 0 No

what is op? for(c=0;c=1000;c++) printf("%c",c);..

Answer / abdur rab

It goes into an infinite loop.

The compiler will check only the syntax, it is upto the
programmer to implement correct logic.

other than initialization, c is always 1000 and there is no
condition to be break the loop

Is This Answer Correct ?    5 Yes 0 No

what is op? for(c=0;c=1000;c++) printf("%c",c);..

Answer / deep

it show compliation error

Is This Answer Correct ?    11 Yes 9 No

what is op? for(c=0;c=1000;c++) printf("%c",c);..

Answer / sriharsha

It print's only what's the ASCII value of 1000 for infinite loop

Is This Answer Correct ?    4 Yes 2 No

what is op? for(c=0;c=1000;c++) printf("%c",c);..

Answer / dally

it will goto infinite loop because each time i=0 and i=100
so it will goto infinite loop.

Is This Answer Correct ?    2 Yes 0 No

what is op? for(c=0;c=1000;c++) printf("%c",c);..

Answer / sreekanth

Warnings:

Test expression for for is assignment expression: c = 1000
The condition test is an assignment expression. Probably,
you mean to use == instead of =. If an assignment is
intended, add an extra parentheses nesting(e.g., if ((a =
b)) ...) to suppress this message. (Use -predassign to
inhibit warning)

Test expression for for not boolean, type int: c = 1000.
Test expression type is not boolean or int. (Use
-predboolint to inhibit warning)

Is This Answer Correct ?    1 Yes 0 No

what is op? for(c=0;c=1000;c++) printf("%c",c);..

Answer / m.kiran kumar

warning occurs as possibly incorrect statement.
and the statement falls into infinite loop printing the
ascii character equivalent to 0

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More C Interview Questions

There is a mobile keypad with numbers 0-9 and alphabets on it. take input of 7 keys and then form a word from the alphabets present on those keys.

0 Answers  


why you will give me a job in TCS.

7 Answers   TCS,


List the difference between a 'copy constructor' and a 'assignment operator' in C?

0 Answers   Accenture,


How can variables be characterized?

0 Answers  


character array A[12] can hold

5 Answers   Wipro,






why array index always starts from zero??

4 Answers   TCS,


If jack lies on Mon, Tue Wed and jill lies on Thursday, Friday and Saturday. If both together tell they lied yesterday. So c the given options and then c cos in the given dates one will be saying the truth and one will be lying. I got Thursday as option because jack is saying the truth he lied yest but jill is lying again as he lies on that day.

0 Answers   TCS,


Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database

2 Answers   TCS, Unisys, Webyog,


main() { int i=5; printf("%d%d%d%d",i++,i--,i); }

10 Answers  


why we are using semicolon at the end of printh statment

2 Answers   HCL,


There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?

0 Answers  


a character variable can at a time store a) 1 character b) 8 characters c) 254 characters d) none of the above

3 Answers  


Categories