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 *a = "Hello ";

char *b = "World";

clrscr();

printf("%s", strcpy(a,b));

}

a. “Hello”

b. “Hello World”

c. “HelloWorld”

d. None of the above

Answers were Sorted based on User's Feedback



main() { char *a = "Hello "; char *b = "World"; cl..

Answer / guest

d) World, copies World on a, overwrites Hello in a.

Is This Answer Correct ?    13 Yes 1 No

main() { char *a = "Hello "; char *b = "World"; cl..

Answer / sandeep tayal

This would produce an error message if you are using g++
compiler in UNIX as g++ does not allow constant strings to
be a part of the char *;

If this is run in Turbo C then it will produce the output
shown in above

Is This Answer Correct ?    3 Yes 0 No

main() { char *a = "Hello "; char *b = "World"; cl..

Answer / sanjay bhosale

This produces runtime exception as we are attempting to read or write protected memory in Visual c++.

Is This Answer Correct ?    1 Yes 0 No

main() { char *a = "Hello "; char *b = "World"; cl..

Answer / vijeselvam

answer is (d)

The correct answer will be "HelloHello"

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Code Interview Questions

typedef struct error{int warning, error, exception;}error; main() { error g1; g1.error =1; printf("%d",g1.error); }

1 Answers  


void main() { if(~0 == (unsigned int)-1) printf(“You can answer this if you know how values are represented in memory”); }

1 Answers  


How to use power function under linux environment.eg : for(i=1;i<=n;i++){ pow(-1,i-1)} since it alerts undefined reference to 'pow'.

2 Answers  


can you use proc sql to manpulate a data set or would u prefer to use proc report ? if so why ? make up an example and explain in detail

0 Answers   TCS,


main() { int c[ ]={2.8,3.4,4,6.7,5}; int j,*p=c,*q=c; for(j=0;j<5;j++) { printf(" %d ",*c); ++q; } for(j=0;j<5;j++){ printf(" %d ",*p); ++p; } }

2 Answers   CSS, Wipro,


main() { int i=5; printf("%d%d%d%d%d%d",i++,i--,++i,--i,i); }

7 Answers  


C statement to copy a string without using loop and library function..

2 Answers   Persistent, TCS,


how can i search an element in an array

2 Answers   CTS, Microsoft, ViPrak,


What is the match merge ? compare data step match merge with proc sql merge - how many types are there ? data step vs proc sql

0 Answers  


struct Foo { char *pName; }; main() { struct Foo *obj = malloc(sizeof(struct Foo)); clrscr(); strcpy(obj->pName,"Your Name"); printf("%s", obj->pName); } a. Your Name b. compile error c. Name d. Runtime error

3 Answers   HCL,


write a program in c to merge two array

2 Answers  


Cluster head selection in Wireless Sensor Network using C programming language.

0 Answers  


Categories