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

What are types of preprocessor in c?

1055


Can we declare variable anywhere in c?

953


Why void is used in c?

1004


What does emoji p mean?

1099


What does c value mean?

1173


Draw a flowchart to produce a printed list of all the students over the age of 20 in a class .The input records contains the name and age of students. Assume a sentinel value of 99 for the age field of the trailer record

5191


difference between native and cross compilers

2108


What is pass by reference in c?

1170


how do you write a function that takes a variable number of arguments? What is the prototype of printf () function?

1923


Explain can static variables be declared in a header file?

1135


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

986


What is the difference between abs() and fabs() functions?

1104


What are the types of macro formats?

1099


write a program to display all prime numbers

1950


Explain what does it mean when a pointer is used in an if statement?

1041