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
write a program using linked list in which each node consists of following information. Name[30] Branch Rollno Telephone no i) Write the program to add information of students in linked list
How can I open files mentioned on the command line, and parse option flags?
Explain built-in function?
How can I read and write comma-delimited text?
Why is a semicolon (;) put at the end of every program statement?
Why do we need functions in c?
What is the right type to use for boolean values in c? Is there a standard type?
Write program to remove duplicate in an array?
Explain high-order bytes.
Explain spaghetti programming?
When is the “void” keyword used in a function?
How to get string length of given string in c?
How can you increase the size of a statically allocated array?
Explain what is the difference between the expression '++a' and 'a++'?
What language is lisp written in?