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...

void main()
{
char c;
while(c=getchar()!='\n')
printf("%d",c);
}
o/p=11 why?

Answer Posted / prashant

The answer would have been 11 only if the while statement would have had a semicolon to finish with , i.e. "while(c=getchar()!='\n');" According to the above code it will generate the ascii of all the characters entered except the newline character.

Regards
Prashant

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is it possible to use curly brackets ({}) to enclose single line code in c program?

1259


What is a pointer variable in c language?

1037


What are the types of type qualifiers in c?

1032


Declare the structure which contains the following members and write in C list of all students who score more than 75 marks. Roll No, Name, Father Name, Age, City, Marks.

1258


Difference between constant pointer and pointer to a constant.

1065


What are runtime error?

1079


What is static memory allocation?

1099


What is gets() function?

1074


Can a void pointer point to a function?

970


How many identifiers are there in c?

962


i have to apply for rbi before that i need to know the the syllabus for the entrance questions. whethet it may be aps or techinical

2276


What is modifier & how many types of modifiers available in c?

983


Is c object oriented?

911


A program is required to print your biographic information including: Names, gender, student Number, Cell Number, line of study and your residential address.

1673


How does sizeof know array size?

1071