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 / sanath

ANS: NULL
It is a bit tricky question. If u observe carefully then we
are incrementing the pointers p1,p2. When it reached the end
of the string, *p2 points to NULL. We have lost the address
of the starting position.

Is This Answer Correct ?    40 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

can any one please explain, how can i access hard disk(physical address)? it is possible by the use of far,near or huge pointer? if yes then please explain......

1809


Can we change the value of static variable in c?

971


Explain how can I read and write comma-delimited text?

1114


How would you rename a function in C?

994


Why is c so powerful?

1064


Can you mix old-style and new-style function syntax?

1048


Explain modulus operator.

999


What is the right type to use for boolean values in c?

990


Tell me the use of bit field in c language?

1016


When would you use a pointer to a function?

993


Describe the header file and its usage in c programming?

1014


Define macros.

1223


Does c have enums?

1027


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

1794


Why should I prototype a function?

1120