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

C Mcqs

P2 is an integer pointer in the given code. The p2 variable is declared as a pointer to an integer by the typedef statement. To correctly print the log of 36.0, the math header file must be included using #include<math.h>. The underscore character is allowed in variable names, while special symbols like asterisk and pipe are not allowed. The program will print "IndiaBIX" 0 times as the loop condition is never satisfied - x is less than 5 for the first iteration but continue skips the print statement, and on the next iteration x is already greater than 10 so break exits the loop.

Uploaded by

Parikshit Kadam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views2 pages

C Mcqs

P2 is an integer pointer in the given code. The p2 variable is declared as a pointer to an integer by the typedef statement. To correctly print the log of 36.0, the math header file must be included using #include<math.h>. The underscore character is allowed in variable names, while special symbols like asterisk and pipe are not allowed. The program will print "IndiaBIX" 0 times as the loop condition is never satisfied - x is less than 5 for the first iteration but continue skips the print statement, and on the next iteration x is already greater than 10 so break exits the loop.

Uploaded by

Parikshit Kadam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
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