# C Programming Questions & Answers: part7

Software Programming : C Programming QUESTIONS AND ANSWERS :: part7 : 1 to 5

Following Software Programming language Entrance Multiple choice objective type questions and answers will help you in Software Programming 2024 examinations :

 1."My salary was increased by 15%!" Select the statement, which will EXACTLY reproduce the line of text above. printf("\"My salary was increased by 15/%\!\"\n"); printf("My salary was increased by 15%!\n"); printf("My salary was increased by 15'%'!\n"); printf("\"My salary was increased by 15%%!\"\n"); printf("\"My salary was increased by 15'%'!\"\n");. ANSWER : printf("\"My salary was increased by 15%%!\"\n"); Explanation : the correct printf statement for "My salary was increased by 15%!" is printf ("\"My salary was increased by 15%%!\"\n");
 2.int a=10,b; b=a++ + ++a; printf("%d,%d,%d,%d",b,a++,a,++a); what will be the output when following code is executed? 12,10,11,13 22,10,11,13 22,11,11,11 12,11,11,11 22,13,13,13. ANSWER : 22,13,13,13. Explanation : the output of the program is 22,13,13,13
 3.short testarray[4][3] = { {1}, {2,3}, {4,5,6}}; printf(�%d\n�, sizeof(testarray)); Assuming a short is two bytes long, what will be printed by the above code? It will not compile because not enough initializers are given 6 7 12 24. ANSWER : 24. Explanation :
 4.while ((x-1)) { ++counter; x--;} Referring to the sample code above, what value will the variable counter have when completed? 0 1 2 3 4. ANSWER : 2 Explanation : the answer for the code is 2. hence the choice is c
 5.How many union members can be initialized? Only one member of a union at any one time Any number of members of a union at one time Union members can not be initialized Only two members of a union at any one time Only two members of a union at any time. ANSWER : Only one member of a union at any one time Explanation : only one member of a union at any one time can be initialized

More C Programming QUESTIONS AND ANSWERS available in next pages

Health is the greatest gift, contentment is the greatest wealth -Buddha
A real entrepreneur is somebody who has no safety net underneath them. Henry Kravis