What is the output of the program given below
#include<stdio.h>
main()
{
char i=0;
for(;i>=0;i++) ;
printf("%d\n",i);
}
Answer Posted / gajanandon
after for there is semicolon...means empty statement. So no
effect of printf.
so for runs till i (char value) increments in positive
direction and terminates once it exceeds 127 (char
limitation).
Hence finally printf will execute and then prints -128.
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What is pointer to pointer in c with example?
What are the different properties of variable number of arguments?
How macro execution is faster than function ?
How to write a program for machine which is connected with server for that server automatically wants to catch the time for user of that machine?
Why do we use & in c?
What is queue in c?
can anyone suggest some site name..where i can get some good data structure puzzles???
What is identifiers in c with examples?
What is void main ()?
Differentiate between calloc and malloc.
What is #include stdio h?
What is the best style for code layout in c?
Find the second largest element in an array with minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same.
What is the difference between formatted&unformatted i/o functions?
hi to every one .. how to view table pool after creating the pooled table? plz help me.. if any knows abt this ..