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 the g value paradox?
Why is C language being considered a middle level language?
Is void a keyword in c?
What is hashing in c?
write a programming in c to find the sum of all elements in an array through function.
What is the use of getch ()?
When should volatile modifier be used?
What is || operator and how does it function in a program?
What is the basic structure of c?
What is the difference between strcpy() and memcpy() function in c programming?
Explain what will the preprocessor do for a program?
Given a valid 24 hour format time find the combination of the value and write a program ,do not hard the value and if any other inputs provided should work with the logic implemented Input: 11:30 Output: 13:10 Input: 18:25 Output: 21:58
Are c and c++ the same?
What is pragma in c?
What is the use of define in c?