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 difference between array and structure in c?
What is bash c?
Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.
What are 3 types of structures?
a number whose only prime factors are 2,3,5, and 7 is call humble number,,write a program to find and display the nth element in this sequence.. sample input : 2,3,4,11,12,13, and 100.. sample output : the 2nd humble number is 2,the 3rd humble number is 3,the 4th humble number is ,the 11th humble number is 12, the 12th humble number is 14, the 13th humble number is 15, the 100th humble number is 450.
How to Throw some light on the splay trees?
the question is that what you have been doing all these periods (one year gap)
How do we make a global variable accessible across files? Explain the extern keyword?
Is c object oriented?
How do you define a string?
Why void is used in c?
How we can insert comments in a c program?
what is the diffrenet bettwen HTTP and internet protocol
How do I use strcmp?
Explain void pointer?