|
|
INTERVIEW QUESTIONS
LANGUAGES
C DETAILS
Question :
main() { int i = 100; clrscr(); printf("%d", sizeof(sizeof(i))); }
|
|
|
Related Questions |
View Answer |
 |
main() { printf("%d, %d", sizeof('c'), sizeof(100)); }
|
View Answer |
 |
void func1(int (*a)[10]) { printf("Ok it works"); } void func2(int a[][10]) { printf("Will this work?"); }
main() { int a[10][10]; func1(a); func2(a); }
|
View Answer |
 |
main() { char *a = "Hello "; char *b = "World"; clrscr(); printf("%s", strcpy(a,b)); }
|
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 |
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
|
|
|