|
Quiz
|
|
C Programming
|
|
1. Bitwise | can be used to set a bit in number?
a. Yes
b. No;
|
|
2. What will be the output of the program?
#include
int main()
{
int y=128;
const int x=y;
printf("%d\n", x);
return 0;
}
a. 128;
b. Garbage value
c. Error
d. 0
|
|
3. Is following declaration is correct?
char (* ( *f( ) ) [ ] ) ( );
a. Yes
b. No;
|
|
4. Global variable are available to all functions. Does there exist a mechanism by way of which it available to some and not to others.
a. Yes
b. No;
|
|
5. Point out the error in the program?
typedef struct data mystruct;
struct data
{
int x;
mystruct *b;
};
a. Error: in structure declaration
b. Linker Error
c. No Error
d. Non of the Above
|
|
6. Which of the following statements are correct about an if-else statements in a C-program?
1. Every if-else statement can be replaced by an equivalent statements using operators
2. Nested if-else statements are allowed.
3. Multiple statements in an if block are allowed.
4. Multiple statements in an else block are allowed.
a. 1 and 2
b. 2 and 3
a. 1,2 and 4
b. 2, 3, 4
|
|
7. The modulus operator cannot be used with a long double.
a. True
b. False
|
|
8. How many bytes are occupied by near, far and huge pointers (DOS)?
a. near=2 far=4 huge=4
b. near=4 far=8 huge=8
c. near=2 far=4 huge=8
d. near=4 far=4 huge=8
|
|
9. Which header file should be included to use functions like malloc() and calloc()?
a. memory.h
b. stdlib.h
c. string.h
d. dos.h
|
|
10. What is the purpose of fflush() function.
a. flushes all streams and specified streams.
b. flushes only specified stream.
c. flushes input/output buffer.
d. flushes file buffer.
|
|
To See the Answers Click here .. !!
|