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 / hari.11

above friend has posted correct answer,
11 is not the correct answer,
it will take all characters into buffer and will not output any answer until we press '\n' character.
So it would print 1 as many times as number of character pressed before '\n'.

e.g.:
s
o/p: 1

sd
o/p: 11

gdfdd
o/p: 11111

111
o/p: 111


for further queries and discussions, visit..

http://forum.campusmaniac.com/
http://www.campusmaniac.com/

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If the size of int data type is two bytes, what is the range of signed int data type?

1026


What is #define size in c?

1197


How do I get an accurate error status return from system on ms-dos?

1128


What is a char in c?

997


What is the difference between far and near ?

1196


What do you mean by keywords in c?

1153


What is #include conio h?

998


What is && in c programming?

1166


Differentiate between declaring a variable and defining a variable?

1044


What is a structure member in c?

1007


what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above

1122


What is the purpose of macro in C language?

1124


What are the different categories of functions in c?

1138


How can I remove the trailing spaces from a string?

1075


What does double pointer mean in c?

1178