Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

which type of aspect you want from the student.

2170


Are pointers really faster than arrays?

1041


How does struct work in c?

1098


Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.

1134


Explain the use of 'auto' keyword in c programming?

1128


What is %d called in c?

1243


What are different types of pointers?

1083


Why is it usually a bad idea to use gets()? Suggest a workaround.

1804


How to throw some light on the b tree?

1099


How is pointer initialized in c?

1039


What is getch() function?

1079


Write a program to find the biggest number of three numbers in c?

1055


What are logical errors and how does it differ from syntax errors?

1312


Explain what is wrong with this program statement?

1131


What is the purpose of scanf() and printf() functions?

1251