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

Write the Program to reverse a string using pointers.

1073


will u please send me the placement papers to my mail???????????????????

1884


What is static memory allocation? Explain

1138


Explain is it valid to address one element beyond the end of an array?

1248


What are the different types of endless loops?

1128


What is a rvalue?

1260


What is the difference between far and near ?

1244


Who is the main contributor in designing the c language after dennis ritchie?

1052


any C program contains only one function, it must be a) void () b) main () c) message () d) abc ()

1169


Is javascript written in c?

1115


What is the difference between c and python?

1233


Why we use void main in c?

1229


What are register variables? What are the advantage of using register variables?

1231


Is anything faster than c?

1062


Write programs for String Reversal & Palindrome check

1137