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 bash c?
What is the difference between exit() and _exit() function?
a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list
What does c mean before a date?
How many types of functions are there in c?
Can the sizeof operator be used to tell the size of an array passed to a function?
Explain what is the difference between text files and binary files?
What are extern variables in c?
What is d'n in c?
What is the difference between āgā and āgā in C?
What does %c do in c?
What do you mean by c what are the main characteristics of c language?
When c language was developed?
Explain what is the difference between #include and #include 'file' ?
What is advantage of pointer in c?