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

design and implement a data structure and performs the following operation with the help of file (included 1000 student marks in 5 sub. and %also) 1.how many students are fail in all 5 subjects (if >35) 2. delete all student data those are fail in all 5 subjects. 3. update the grace marks (5 no. if exam paper is 100 marks) 4. arrange the student data in ascending order basis of marks. 5.insert double of deleted students with marks in the list.

1923


Why is it important to memset a variable, immediately after allocating memory to it ?

2000


There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?

1243


What is the behavioral difference when include header file in double quotes (“”) and angular braces (<>)?

1271


What is an array in c?

1001


What is c system32 taskhostw exe?

975


What is nested structure with example?

1012


int far *near * p; means

3505


What are the advantages of c preprocessor?

1209


Is it better to use malloc() or calloc()?

1065


Explain what are preprocessor directives?

1015


Which is an example of a structural homology?

1246


Which driver is a pure java driver

1532


What is masking?

1102


What is the difference between struct and typedef struct in c?

1083