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 / sumeet saini

It says %d which means it prints integer value. If we want to print character we need to write %c. So the answer is right. If we replace %d with %c . This program will print what ever character we hit from keyboard until we press enter

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what does the format %10.2 mean when included in a printf statement?

1364


Why is c called "mother" language?

1293


void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }

1725


How do you generate random numbers in C?

1199


What happens if header file is included twice?

1151


Explain the binary height balanced tree?

1188


Tell me about low level programming languages.

1131


How can I open a file so that other programs can update it at the same time?

1187


Explain what is the difference between functions getch() and getche()?

1055


What is the description for syntax errors?

1170


What do you mean by dynamic memory allocation in c? What functions are used?

1163


Is c programming hard?

1030


What are reserved words with a programming language?

1137


What is the difference between declaring a variable by constant keyword and #define ing that variable?

3371


When should a far pointer be used?

1129