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

Linked lists -- can you tell me how to check whether a linked list is circular?

1071


In which layer of the network datastructure format change is done

1875


How can I get back to the interactive keyboard if stdin is redirected?

1171


Is it possible to initialize a variable at the time it was declared?

1204


Are pointers really faster than arrays?

1011


How can I trap or ignore keyboard interrupts like control-c?

1052


How can you be sure that a program follows the ANSI C standard?

1593


Write a program to reverse a linked list in c.

1106


What are header files and explain what are its uses in c programming?

1106


What are types of structure?

1102


Which are low level languages?

1083


differentiate built-in functions and user – defined functions.

1070


What is function in c with example?

1134


Process by which one bit pattern in to another by bit wise operation is?

1140


What is pointer to pointer in c?

1098