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

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

2740


How can I open files mentioned on the command line, and parse option flags?

1015


Explain built-in function?

1088


How can I read and write comma-delimited text?

1010


Why is a semicolon (;) put at the end of every program statement?

1030


Why do we need functions in c?

956


What is the right type to use for boolean values in c? Is there a standard type?

967


Write program to remove duplicate in an array?

1026


Explain high-order bytes.

1061


Explain spaghetti programming?

1189


When is the “void” keyword used in a function?

1428


How to get string length of given string in c?

1010


How can you increase the size of a statically allocated array?

1031


Explain what is the difference between the expression '++a' and 'a++'?

1153


What language is lisp written in?

1165