0% found this document useful (0 votes)
40 views2 pages

C Mcqs

Download as docx, pdf, or txt
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 2

1. In the following code, the P2 is Integer Pointer or Integer?

typedef int *ptr;


ptr p1, p2;
A.

Integer

B.

Integer pointer

C.

Error in declaration

D.

None of above

2. Which statement will you add in the following program to work it correctly?
#include<stdio.h>
int main()
{
printf("%f\n", log(36.0));
return 0;
}
A.
#include<conio.h>
B.
#include<math.h>
C.
#include<stdlib.h>
D.
#include<dos.h>
3. Which of the following special symbol allowed in a variable name?
A.
* (asterisk)
B.
| (pipeline)
C.
- (hyphen)
D.
_ (underscore)
4. How would you round off a value from 1.66 to 2.0?
A.
ceil(1.66)
B.
floor(1.66)
C.
roundup(1.66) D.
roundto(1.66)
5. 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?
A.
.
B.
&
C.
*
D.
->
6. Which bitwise operator is suitable for turning off a particular bit in a number?
A.
&& operator B.
& operator
C.
|| operator
D.
! operator
7. Input/output function prototypes and macros are defined in which header file?
A.
conio.h
B.
stdlib.h
C.
stdio.h
D.
dos.h
8. How many times "IndiaBIX" is get printed?
#include<stdio.h>
int main()
{
int x;
for(x=-1; x<=10; x++)
{
if(x < 5)
continue;
else
break;
printf("IndiaBIX");

}
return 0;
}
A.

Infinite times

B.

11 times

C.

0 times

D.

10 times

9. Which of the following is not logical operator?


A.
&
B.
&&
C.
||
D.
!
10. The keyword used to transfer control from a function back to the calling function is
A.
switch
B.
goto
C.
go back
D.
return
11. How many times the program will print "IndiaBIX" ?
#include<stdio.h>
int main()
{
printf("IndiaBIX");
main();
return 0;
}
A.
C.

Infinite times
65535 times

B.
D.

B.
B.
D.
A.
D.
B.
C.
C.
A.
D.
D.

Integer pointer
#include<math.h>
_ (underscore)
ceil(1.66)
->
& operator
stdio.h
0 times
&
return
Till stack overflows

12.

Key
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.

32767 times
Till stack overflows

You might also like