Placement papers on C - Set 5

Placement papers on C - Set 5


1. What does the following declaration mean?

int (*ptr)[10];

ptr is array of pointers to 10 integers
ptr is a pointer to an array of 10 integers
ptr is an array of 10 integers
ptr is an pointer to array
View Answer / Hide Answer

ANSWER: ptr is a pointer to an array of 10 integers




2. In C, if you pass an array as an argument to a function, what actually gets passed?

Value of elements in array
First element of the array
Base address of the array
Address of the last element of array
View Answer / Hide Answer

ANSWER: Base address of the array




3. Which among the following is odd one out?

printf
fprintf
putchar
scanf
View Answer / Hide Answer

ANSWER: scanf




4. For a typical program, the input is taken using.

scanf
Files
Command-line
None of the mentioned
View Answer / Hide Answer

ANSWER: None of the mentioned




5. What does the following command line signify? prog1I prog2

It runs prog1 first, prog2 second
It runs prog2 first, prog1 second
It runs both the programs, pipes output of prog1 to input of prog2
It runs both the programs, pipes output of prog2 to input of prog1
View Answer / Hide Answer

ANSWER: It runs both the programs, pipes output of prog1 to input of prog2




6. What is the default return-type of getchar()?

char
int
char *
Reading character doesn't require a return-type
View Answer / Hide Answer

ANSWER: int




7. The value of EOF is_____.

-1
0
1
10
View Answer / Hide Answer

ANSWER: -1




8. What is the use of getchar()?

The next input character each time it is called
EOF when it encounters end of file.
Both a and b
None of the mentioned
View Answer / Hide Answer

ANSWER: Both a and b




9. Which is true?

The symbolic constant EOF is defined in
The value is typically -1,
Both a and b
Either a or b
View Answer / Hide Answer

ANSWER: Both a and b




10. What is the use of putchar()?

The character written
EOF is an error occurs
Nothing
Both a and b
View Answer / Hide Answer

ANSWER: Both a and b


Post your comment