| 1. | Which of the following statements are correct about the below program? | ||||||||||||||||
Answer: Option B Explanation: Step 1: int i = 0; here variable i is declared as an integer type and initialized to '0'(zero). Step 2: i++; here variable i is increemented by 1(one). Hence, i = 1 Step 3: if(i <= 5) becomes if(1 <= 5) here we are checking '1' is less than or equal to '5'. Hence the if condition is satisfied. Step 4: printf("IndiaBIX\n"); It prints "IndiaBIX" Step 5: exit(); terminates the program execution. Hence the output is "IndiaBIX". Learn more problems on : Control Instructions Discuss about this problem : Discuss in Forum |
| 2. | What will be the output of the program? | ||||||||||||||||
Answer: Option B Explanation: if(a < 0.7f) here a is a float variable and 0.7f is a float constant. The float variable a is not less than 0.7f float constant. But both are equal. Hence the if condition is failed and it goes to else it prints 'C++' Example: Output: 0.6999999881 0.6999999881 Learn more problems on : Floating Point Issues Discuss about this problem : Discuss in Forum |
| 3. | Which of the following is suitable data type for the variable a in the statement given below? (datatype) a = 23.45; | ||||||||||||||||
Answer: Option A Learn more problems on : Floating Point Issues Discuss about this problem : Discuss in Forum |
| 4. | Functions cannot return more than one value at a time | ||||||||
Answer: Option A Explanation: True, A function cannot return more than one value at a time. because after returning a value the control is given back to calling function. Learn more problems on : Functions Discuss about this problem : Discuss in Forum |
| 5. | What will be the output of the program? | ||||||||||||||||
Answer: Option B Learn more problems on : C Preprocessor Discuss about this problem : Discuss in Forum |
| 6. | Macros with arguments are allowed | ||||||||
Answer: Option A Explanation: True, A macro may have arguments. Example: #define CUBE(X)(X*X*X) Learn more problems on : C Preprocessor Discuss about this problem : Discuss in Forum |
| 7. | If a variable is a pointer to a structure, then which of the following operator is used to access data members of the structure through the pointer variable? | ||||||||||||||||
|
| 8. | Point out the error in the program | ||||||||||||||||
Answer: Option C Explanation: While reading the code there is no error, but upon running the program having an unitialised variable can cause the program to crash (Null pointer assignment).Learn more problems on : Pointers Discuss about this problem : Discuss in Forum |
| 9. | Are the expression *ptr++ and ++*ptr are same? | ||||||||
Answer: Option B Explanation: *ptr++ increments the pointer and not the value, whereas the ++*ptr increments the value being pointed by ptrLearn more problems on : Pointers Discuss about this problem : Discuss in Forum |
| 10. | What will be the output of the program ? | ||||||||||||||||
|
| 11. | Union elements can be of different sizes. | ||||||||
Answer: Option A Learn more problems on : Structures, Unions, Enums Discuss about this problem : Discuss in Forum |
| 12. | Is it necessary that the size of all elements in a union should be same? | ||||||||
Answer: Option B Learn more problems on : Structures, Unions, Enums Discuss about this problem : Discuss in Forum |
| 13. | What is the purpose of "rb" in fopen() function used below in the code? | ||||||||||||||||
Answer: Option A Explanation: The file source.txt will be opened in the binary mode. Learn more problems on : Input / Output Discuss about this problem : Discuss in Forum |
| 14. | What will be the output of the program ? | ||||||||||||||||
Answer: Option B Learn more problems on : Input / Output Discuss about this problem : Discuss in Forum |
| 15. | stderr, stdin, stdout are FILE pointers | ||||||||
Answer: Option A Explanation: Yes, these will be declared like The corresponding stdio.h variable is FILE* stdin; The corresponding stdio.h variable is FILE* stdout; The corresponding stdio.h variable is FILE* stderr; Learn more problems on : Input / Output Discuss about this problem : Discuss in Forum |
| 16. | What will be the output of the program (myprog.c) given below if it is executed from the command line? cmd> myprog 1 2 3 | ||||||||||||||||
Answer: Option B Learn more problems on : Command Line Arguments Discuss about this problem : Discuss in Forum |
| 17. | What will be the output of the program (myprog.c) given below if it is executed from the command line? cmd> myprog one two three If the first value printed by the above program is 65517, what will be the rest of output? | ||||||||||||||||
Answer: Option B Learn more problems on : Command Line Arguments Discuss about this problem : Discuss in Forum |
| 18. | Bitwise | can be used to set multiple bits in number. | ||||||||
Answer: Option A Learn more problems on : Bitwise Operators Discuss about this problem : Discuss in Forum |
| 19. | What do the following declaration signify? | ||||||||||||||||
Answer: Option A Learn more problems on : Complicated Declarations Discuss about this problem : Discuss in Forum |
| 20. | We can allocate a 2-Dimensional array dynamically. | ||||||||
Answer: Option A Learn more problems on : Complicated Declarations Discuss about this problem : Discuss in Forum |


No comments:
Post a Comment