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

An arrangement of information in memory in such a way that it can be easily accessed and processed by a programming language a) string b) data structure c) pointers d) array

0 Answers  


Can we declare variables anywhere in c?

0 Answers  


When is a “switch” statement preferable over an “if” statement?

0 Answers  


Is a house a mass structure?

0 Answers  


#include<stdio.h> main() { int a[3]; int *I; a[0]=100;a[1]=200;a[2]=300; I=a; Printf(“%d\n”, ++*I); Printf(“%d\n”, *++I); Printf(“%d\n”, (*I)--); Printf(“%d\n”, *I); } what is the o/p a. 101,200,200,199 b. 200,201,201,100 c. 101,200,199,199 d. 200,300,200,100

1 Answers  






Why is struct padding needed?

0 Answers  


When can you use a pointer with a function?

0 Answers  


What are the advantages of using linked list for tree construction?

0 Answers  


please tell me the logic for this C program : INPUT (string):ABCD OUTPUT :BCDA CDAB DABC

2 Answers   Mphasis,


what is the output for the code : main() { int i,j; printf("%d %d ",scanf("%d%d",&i,&j)); }

20 Answers   Infosys,


How can I increase the allowable number of simultaneously open files?

1 Answers   ABC,


What is the advantage of a random access file?

0 Answers  


Categories