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 / vadivel t

In addtion to the answer #5.

printf("%s\n",p2); will print the values from 6th byte to
20th byte.

6th byte to 20th bytes of the memory will contain some
Garbage value. So the output will be a string of garbage
values.


For desired o/p see the ans #5

Is This Answer Correct ?    6 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)

1286


Where in memory are my variables stored?

1194


What are the 5 data types?

1147


Does c have function or method?

1012


Can a file other than a .h file be included with #include?

1168


Explain how can you tell whether two strings are the same?

1023


int far *near * p; means

3563


Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.

1108


How can you increase the allowable number of simultaneously open files?

1169


Why is a semicolon (;) put at the end of every program statement?

1080


Explain what are multibyte characters?

1206


What is difference between scanf and gets?

1289


pierrot's divisor program using c or c++ code

2247


What is c value paradox explain?

1105


What are qualifiers in c?

1043