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);
}

Answer Posted / vignesh1988i

actually in this problem, the p2 will take characters after '\0' too from p1 upto the size of p2 come to an end.

so it prints
output :

Name #^$&dhd


thank u

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is c a great language, or what?

1123


formula to convert 2500mmh2o into m3/hr

1000


what is use of malloc and calloc?

1908


What is the translation phases used in c language?

1124


What is the value of a[3] if integer a[] = {5,4,3,2,1}?

1096


Why can't I perform arithmetic on a void* pointer?

1101


What is character set?

1173


If one class contains another class as a member, in what order are the two class constructors called a) Constructor for the member class is called first b) Constructor for the member class is called second c) Only one of the constructors is called d) all of the above

1066


Explain how do you print an address?

1146


Is stack a keyword in c?

1091


Is null a keyword in c?

1198


What is bubble sort in c?

1056


What does a pointer variable always consist of?

1104


What's the best way of making my program efficient?

1110


What does the file stdio.h contain?

1070