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...


what will the following program do?
void main()
{
int i;
char a[]="String";
char *p="New Sring";
char *Temp;
Temp=a;
a=malloc(strlen(p) + 1);
strcpy(a,p);
//Line no:9//
p = malloc(strlen(Temp) + 1);
strcpy(p,Temp);
printf("(%s, %s)",a,p);
free(p);
free(a);
}
//Line no 15//

a) Swap contents of p & a and print:(New string, string)
b) Generate compilation error in line number 8
c) Generate compilation error in line number 5
d) Generate compilation error in line number 7
e) Generate compilation error in line number 1



what will the following program do? void main() { ..

Answer / abhiraj

a = malloc....


this sentence will give the error Lvalue required..

Is This Answer Correct ?    11 Yes 0 No

Post New Answer

More C Interview Questions

When should structures be passed by values or by references?

0 Answers   Adobe,


What are pointers in C?

5 Answers   KPIT,


program to print circle structure

1 Answers  


1 232 34543 4567654 can anyone tell me how to slove this c question

6 Answers  


how to find the largest element of array without using relational operater?

6 Answers   Satyam, Wipro,


How can you restore a redirected standard stream?

0 Answers  


How can I read a directory in a C program?

2 Answers   Bright Outdoor, Wipro,


find a number whether it is even or odd without using any control structures and relational operators?

22 Answers   Microsoft, Shashank Private Limited,


Here is alphabets : abcdefgh 1) how to reverse. as hgfedcba 2) after reversal, how to group them in a pair hg fe dc ba.

2 Answers  


Write a program to generate the first n terms in the series --- 2,3,5,7,11,...,17

0 Answers  


What do you mean by command line argument?

0 Answers   TCS,


main() { char x; while(x=0;x<=255;x++) printf("\nAscii value %d Charater %c",x,x); }

2 Answers  


Categories