
Instruction:
- This is a FREE online test. DO NOT pay money to anyone to attend this test.
- Total number of questions : 20.
- Time alloted : 20 minutes.
- Each question carry 1 mark, no negative marks.
- DO NOT refresh the page.
- All the best :-).
1. | The modulus operator cannot be used with a long double. |
|||||||||
Your Answer: Option (Not Answered) Correct Answer: Option A Explanation:
fmod(x,y) - Calculates x modulo y, the remainder of x/y.
Learn more problems on : Control Instructions Discuss about this problem : Discuss in Forum |
2. | What will be the output of the program?
|
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option A Explanation: Step 1: int i=-3, j=2, k=0, m; here variable i, j, k, m are declared as an integer type and variable i, j, k are initialized to -3, 2, 0 respectively.
Step 2: m = ++i && ++j && ++k; Step 3: printf("%d, %d, %d, %d\n", i, j, k, m); In the previous step the value of i,j,k are increemented by '1'(one). Hence the output is "-2, 3, 1, 1". Learn more problems on : Expressions Discuss about this problem : Discuss in Forum |
3. | In a function two return statements should never occur. |
|||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Explanation: No, In a function two return statements can occur but not successively. Example:
Output: Learn more problems on : Functions Discuss about this problem : Discuss in Forum |
4. | It is necessary that a header files should have a .h extension? |
|||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Explanation: No, the header files have any kind of extension. Learn more problems on : C Preprocessor Discuss about this problem : Discuss in Forum |
5. | How many bytes are occupied by near, far and huge pointers (DOS)? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option A Explanation: near=2, far=4 and huge=4 pointers exist only under DOS. Under windows and Linux every pointers is 4 bytes long. Learn more problems on : Pointers Discuss about this problem : Discuss in Forum |
6. | What will be the output of the program ?
|
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option D Learn more problems on : Pointers Discuss about this problem : Discuss in Forum |
7. | What will be the output of the program ?
|
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option D Learn more problems on : Pointers Discuss about this problem : Discuss in Forum |
8. | Which of the statements is correct about the program?
|
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option D Learn more problems on : Pointers Discuss about this problem : Discuss in Forum |
9. | What will be the output of the program ?
|
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Explanation: A string is a collection of characters terminated by '\0'. Step 1: char str[] = "India\0\BIX\0"; The variable str is declared as an array of characters and initialized with value "India" Step 2: printf("%s\n", str); It prints the value of the str. The output of the program is "India". Learn more problems on : Strings Discuss about this problem : Discuss in Forum |
10. | What will be the output of the program in Turbo C (under DOS)?
|
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Learn more problems on : Structures, Unions, Enums Discuss about this problem : Discuss in Forum |
11. | Point out the error in the program?
|
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Explanation: Bit field type must be signed int or unsigned int. The char type: char scheme:4; is also a valid statement. Learn more problems on : Structures, Unions, Enums Discuss about this problem : Discuss in Forum |
12. | Point out the error in the program?
|
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Explanation: The struct emp is mentioned in the prototype of the function modify() before declaring the structure.To solve this problem declare struct emp before the modify() prototype. Learn more problems on : Structures, Unions, Enums Discuss about this problem : Discuss in Forum |
13. | The '.' operator can be used access structure elements using a structure variable. |
|||||||||
Your Answer: Option (Not Answered) Correct Answer: Option A Learn more problems on : Structures, Unions, Enums Discuss about this problem : Discuss in Forum |
14. | Can we specify a variable filed width in a scanf() format string? |
|||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Explanation: In scanf() a * in a format string after a % sign is used for the suppression of assignment. That is, the current input field is scanned but not stored. Learn more problems on : Input / Output Discuss about this problem : Discuss in Forum |
15. | Which header file should be included to use functions like malloc() and calloc()? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Learn more problems on : Memory Allocation Discuss about this problem : Discuss in Forum |
16. | If malloc() successfully allocates memory it returns the number of bytes it has allocated. |
|||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Explanation: Syntax: void *malloc(size_t size); The malloc() function shall allocate unused space for an object whose size in bytes is specified by size and whose value is unspecified. The order and contiguity of storage allocated by successive calls to malloc() is unspecified. The pointer returned if the allocation succeeds shall be suitably aligned so that it may be assigned to a pointer to any type of object and then used to access such an object in the space allocated (until the space is explicitly freed or reallocated). Each such allocation shall yield a pointer to an object disjoint from any other object. The pointer returned points to the start (lowest byte address) of the allocated space. If the space cannot be allocated, a null pointer shall be returned. If the size of the space requested is 0, the behavior is implementation-defined: the value returned shall be either a null pointer or a unique pointer. Learn more problems on : Memory Allocation Discuss about this problem : Discuss in Forum |
17. | In a function that receives variable number of arguments the fixed arguments passed to the function can be at the end of argument list. |
|||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Learn more problems on : Variable Number of Arguments Discuss about this problem : Discuss in Forum |
18. | We can allocate a 2-Dimensional array dynamically. |
|||||||||
Your Answer: Option (Not Answered) Correct Answer: Option A Learn more problems on : Complicated Declarations Discuss about this problem : Discuss in Forum |
19. | Are the following declarations same?
|
|||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Learn more problems on : Complicated Declarations Discuss about this problem : Discuss in Forum |
20. | What is the purpose of fflush() function. |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option A Explanation: "fflush()" flush any buffered output associated with filename, which is either a file opened for writing or a shell command for redirecting output to a pipe or coprocess. Example: Learn more problems on : Library Functions Discuss about this problem : Discuss in Forum |