main() { char *p = "hello world"; p[0] = 'H'; printf("%s", p); } a. Runtime error. b. “Hello world” c. Compile error d. “hello world”
5 19872main() { 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 12855How will you print % character? a. printf(“\%”) b. printf(“\\%”) c. printf(“%%”) d. printf(“\%%”)
4 9866const 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 9576struct 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 8586struct 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 10188main() { 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 10304main() { 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 14826void 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 11227main() { int i = 100; clrscr(); printf("%d", sizeof(sizeof(i))); } a. 2 b. 100 c. 4 d. none of the above
5 12020main() { char c; int i = 456; clrscr(); c = i; printf("%d", c); } a. 456 b. -456 c. random number d. none of the above
3 12992void main () { int x = 10; printf ("x = %d, y = %d", x,--x++); } a. 10, 10 b. 10, 9 c. 10, 11 d. none of the above
2 14954main() { int i =10, j = 20; clrscr(); printf("%d, %d, ", j-- , --i); printf("%d, %d ", j++ , ++i); } a. 20, 10, 20, 10 b. 20, 9, 20, 10 c. 20, 9, 19, 10 d. 19, 9, 20, 10
4 13108Post New HCL C Code Interview Questions
Explain how to bind the controls(best practice) comboboxes to the data in the dataset?
How can you prepare customized html report using testng in hybrid framework?
How do I edit a joomla template?
Particulars Dr Cr Capital 10,000 Machinery 3000 debit 2500 1400 sales - 14,500 drawings 900 purchase 9500 wages 5000 bank 1500 Opening balance 2000 rent 450 salary 200 carriage 150 total ___________ _________ 25,900 25,900 ____________ ________ how to find closing stock as on 31st dec,1998. wages outstanding 200/- sunnery expenses outstanding 100/- rent prepaid 100/-
Explain oops concepts in detail?
What is the difference between microstrategy and cognos reporting tool?
What is the Cassandra Coefficient ?
What does the’$_’ symbol mean?
can any body tell me what is the process of between after getting a documents and testcase writing.
What is the purpose of @emailvalidator?
Why axial flow compressor is preferred for gas turbines for aeroplanes ?
How to write a expression to display the first letter in Caps in each word using transformer stage ? Please let me know ASAP Thanks in advance...
Explain various types of breaks.
What are the accounting events that are frequently involved in compound entries?
Where do you see yourself in next 3 to 5 years from now?