|
|
INTERVIEW QUESTIONS
LANGUAGES
C DETAILS
Question :
main() { char *a = "Hello "; char *b = "World"; clrscr(); printf("%s", strcpy(a,b)); }
|
|
|
Related Questions |
View Answer |
 |
main() { char *a = "Hello "; char *b = "World"; clrscr(); printf("%s", strcat(a,b)); }
|
View Answer |
 |
struct Foo { char *pName; char *pAddress; }; main() { struct Foo *obj = malloc(sizeof(struct Foo)); clrscr(); obj->pName = malloc(100); obj->pAddress = malloc(100); strcpy(obj->pName,"Your Name"); strcpy(obj->pAddress, "Your Address"); free(obj); printf("%s", obj->pName); printf("%s", obj->pAddress); }
|
View Answer |
 |
struct Foo { char *pName; }; main() { struct Foo *obj = malloc(sizeof(struct Foo)); clrscr(); strcpy(obj->pName,"Your Name"); printf("%s", obj->pName); }
|
View Answer |
 |
const int perplexed = 2; #define perplexed 3 main() { #ifdef perplexed #undef perplexed #define perplexed 4 #endif printf("%d",perplexed); }
|
View Answer |
 |
How will you print % character?
|
View Answer |
 |
main() { char * strA; char * strB = I am OK; memcpy( strA, strB, 6); }
|
View Answer |
 |
main() { char *p = "hello world"; p[0] = 'H'; printf("%s", p); }
|
View Answer |
 |
main() { int i, j; scanf("%d %d"+scanf("%d %d", &i, &j)); printf("%d %d", i, j); }
|
View Answer |
 |
main() { int i, j, *p; i = 25; j = 100; p = &i; // Address of i is assigned to pointer p printf("%f", i/(*p) ); // i is divided by pointer p }
|
View Answer |
 |
union u { union u { int i; int j; }a[10]; int b[10]; }u; main() { printf("n%d", sizeof(u)); printf(" %d", sizeof(u.a)); // printf("%d", sizeof(u.a[4].i)); }
|
View Answer |
Please Note: We keep on updating better answers to this site. Subscribe to our newsletter to get notified when better answer is posted.
| Notify me when better answer is posted!
|
View ALL C Interview Questions
|
|
|