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

Q.1 write aprogram to stack using linklist o insert 40 items? Q.2 write a program to implement circular queue with help of linklist?

2127


Write a program to identify if a given binary tree is balanced or not.

1164


What is the difference between far and near in c?

1067


What are data structures in c and how to use them?

1172


how much salary u want ? why u join in our company? your domain is core sector why u prefer software ?

1985


What will be the outcome of the following conditional statement if the value of variable s is 10?

1292


Is array name a pointer?

1030


What is signed and unsigned?

1067


Do you know what are bitwise shift operators in c programming?

1103


What is a nested formula?

1157


how to build a exercise findig min number of e heap with list imlemented?

2077


What is a macro?

1107


What is the argument of a function in c?

1053


Where can I get an ansi-compatible lint?

1150


What is a structure and why it is used?

1226