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

What is the explanation for modular programming?

0 Answers  


the output will be #include<stdio.h> int main () { int i; i = 9/2; printf("%i",i); return 0; }

4 Answers   CMC, TCS,


Give the rules for variable declaration?

0 Answers  


What is the difference between functions abs() and fabs()?

0 Answers  


what is data structure

5 Answers   Maveric, TCS,


#include<stdio.h> #include<conio.h> struct stu { int i; char j; }; union uni { int i; char j; }; void main() { int j,k; clrscr(); struct stu s; j=sizeof(s); printf("%d",j); union uni u; k=sizeof(u); printf("%d",k); getch(); } what is value of j and k.

2 Answers   Facebook,


void main(int n) { if(n==0) return; main(--n); printf("%d ",n); getch(); } how it work and what will be its output...............it any one know ans plz reply

0 Answers  


program to print upper & lower triangle of a matrix

2 Answers   TCS,


what is difference between ++(*p) and (*p)++

17 Answers   Accenture, HCL, IBM,


? ???Mirror Mirror on the wall????????

1 Answers   channel V, DPI,


Explain the difference between call by value and call by reference in c language?

0 Answers  


Can a variable be both constant and volatile?

0 Answers  


Categories