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

What is the meaning of ?

1042


Is there a way to compare two structure variables?

1127


Explain what is page thrashing?

1105


What is a program flowchart and how does it help in writing a program?

1148


How to set file pointer to beginning c?

1205


Define VARIABLE?

1173


In C, What is the #line used for?

2218


what do you mean by enumeration constant?

1015


Why static is used in c?

1096


What is the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.

4286


What is d'n in c?

1125


How are 16- and 32-bit numbers stored?

1293


write a program to rearrange the array such way that all even elements should come first and next come odd

2285


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

1177


The performance of an operation in several steps with each step using the output of the preceding step a) recursion b) search c) call by value d) call by reference

1236