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)); } a. 4, 4, 4 b. 40, 4, 4 c. 1, 100, 1 d. 40 400 4
3 8801main() { int (*functable[2])(char *format, ...) ={printf, scanf}; int i = 100; (*functable[0])("%d", i); (*functable[1])("%d", i); (*functable[1])("%d", i); (*functable[0])("%d", &i); } a. 100, Runtime error. b. 100, Random number, Random number, Random number. c. Compile error d. 100, Random number
1 14379main() { 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 } a. Runtime error. b. 1.00000 c. Compile error d. 0.00000
3 9365main() { int i, j; scanf("%d %d"+scanf("%d %d", &i, &j)); printf("%d %d", i, j); } a. Runtime error. b. 0, 0 c. Compile error d. the first two values entered by the user
2 10263main() { char *p = "hello world"; p[0] = 'H'; printf("%s", p); } a. Runtime error. b. “Hello world” c. Compile error d. “hello world”
5 20034main() { char * strA; char * strB = I am OK; memcpy( strA, strB, 6); } a. Runtime error. b. I am OK c. Compile error d. I am O
4 13029How will you print % character? a. printf(“\%”) b. printf(“\\%”) c. printf(“%%”) d. printf(“\%%”)
4 10050const int perplexed = 2; #define perplexed 3 main() { #ifdef perplexed #undef perplexed #define perplexed 4 #endif printf("%d",perplexed); } a. 0 b. 2 c. 4 d. none of the above
1 9662struct 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 8729struct 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); } a. Your Name, Your Address b. Your Address, Your Address c. Your Name Your Name d. None of the above
2 10327main() { char *a = "Hello "; char *b = "World"; clrscr(); printf("%s", strcat(a,b)); } a. Hello b. Hello World c. HelloWorld d. None of the above
3 10432main() { char *a = "Hello "; char *b = "World"; clrscr(); printf("%s", strcpy(a,b)); } a. “Hello” b. “Hello World” c. “HelloWorld” d. None of the above
4 15009void 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); } a. Ok it works b. Will this work? c. Ok it worksWill this work? d. None of the above
1 11312main() { int i = 100; clrscr(); printf("%d", sizeof(sizeof(i))); } a. 2 b. 100 c. 4 d. none of the above
5 12231Post New HCL Interview Questions
What are the differences between datamart vs. Reporting cube?
132/6.6𝚔𝚟 𝚝𝚛𝚊𝚗𝚜𝚏𝚘𝚛𝚖𝚎𝚛 𝚗𝚎𝚞𝚝𝚛𝚊𝚕 𝚑𝚊𝚜 𝚘𝚗𝚎 𝚎𝚊𝚛𝚝𝚑 𝚙𝚒𝚝 𝚍𝚎𝚍𝚒𝚌𝚊𝚝𝚎𝚍. 𝙸'𝚟𝚎 𝚊𝚗𝚘𝚝𝚑𝚎𝚛 𝚝𝚛𝚊𝚗𝚜𝚏𝚘𝚛𝚖𝚎𝚛 𝚘𝚏 6.6𝚔𝚟/415𝚟 𝚌𝚊𝚗 𝙸 𝚌𝚘𝚗𝚗𝚎𝚌𝚝 𝚗𝚎𝚞𝚝𝚛𝚊𝚕 𝚝𝚘 𝚜𝚊𝚖𝚎 𝚎𝚊𝚛𝚝𝚑 𝚙𝚒𝚝 𝚊𝚜 𝚘𝚏 13/6.𝚔𝚟 𝚝𝚛𝚊𝚗𝚜𝚏𝚘𝚛𝚖𝚎𝚛?? 𝙸𝚏 𝙽𝚘.. 𝚃𝚑𝚎𝚗 𝚠𝚑𝚢??
What are the advantages of properties in c#?
What is the use of intialize verb?
I am working in pharma company from last 15 years and my age is 36 years now i want to join BPO can i join ?
How to Create an Intranet Site Using ASP.NET MVC?
We have 6.6 KV, 250 KW HT Motor and i want to run this motor with 250 KW LT Variable frequency drive. Is this Possible? How? what are the major modification required?
Which is the best language for machine learning?
How do you change a file format?
Can you run linux on any laptop?
To create a windows 7 workstation that supports multiple languages, you must begin by installing the english language version. State true or false.
What is synonyms?
why should we hire you if we can promote our employee from within?
What is supply management in srm ?
How do you check whether the two variables are pointing to the same object in python?