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...

main()
{
char *p1="Name";
char *p2;
p2=(char *)malloc(20);
while(*p2++=*p1++);
printf("%s\n",p2);
}
what is the output?



Answer Posted / shruti

-> while(*p2++ "=" *p1++)
the syntax of while is
while("condition");

in condition statement the assignment operator is used in a
wrong way..
when we are using loop it should be "=="..

we cannot copy the value of p1 in p2, the way its mentioned
here..


** It will either give an error or display some garbage
value in p2 , or no value..
depends on what p2 is initialised to implicitly..

Is This Answer Correct ?    1 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is structure in c definition?

982


a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above

1324


Can a pointer be volatile in c?

930


What is variable and explain rules to declare variable in c?

1015


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

1059


What is the purpose of sprintf?

1060


hi to every one .. how to view table pool after creating the pooled table? plz help me.. if any knows abt this ..

1868


What is the value of c?

1005


Is c weakly typed?

962


Can the size of an array be declared at runtime?

1023


Is Exception handling possible in c language?

1989


What are structure types in C?

1047


What is the use of pointers in C?

1021


what is the different bitween abap and abap-hr?

2212


Why are algorithms important in c program?

1064