What is the output of the program given below

#include<stdio.h>
main()
{
char i=0;
for(;i>=0;i++) ;
printf("%d\n",i);
}

Answers were Sorted based on User's Feedback



What is the output of the program given below #include<stdio.h> main() { ..

Answer / madhu

127.As i is a char the last digit would be 127,so the loop
stops at that point.
I crosschecked it writing a program.

Is This Answer Correct ?    1 Yes 9 No

Post New Answer

More C Interview Questions

get any number as input except 1 and the output will be 1.without using operators,expressions,array,structure.don't print 1 in printf statement

3 Answers  


What is the difference between the = symbol and == symbol?

0 Answers  


What is the difference between text and binary modes?

0 Answers  


Why we use int main and void main?

0 Answers  


Explain the bubble sort algorithm.

0 Answers  






write a programme to convert temperature from farenheit to celcius?

4 Answers   IBM,


illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question

0 Answers  


do u print this format '(((())))'. This brackets is based on user input like 4 or 5 or 6,without using any loop's?

1 Answers   Oracle,


Differentiate between Macro and ordinary definition.

0 Answers   Motorola,


What is switch in c?

0 Answers  


What is the purpose of sprintf() function?

0 Answers  


the statement while(i) puts the entire logic in loop. this loop is called a) indefinite loop b) definite loop c) loop syntax wrong d) none of the above

0 Answers  


Categories