Академический Документы
Профессиональный Документы
Культура Документы
#include<stdio.h>
int main(){
printf("%d\t",sizeof(6.5));
printf("%d\t",sizeof(90000));
printf("%d",sizeof('A'));
return 0;
}
Choose all that apply:
(A) 4 2 1
(B) 8 2 1
(C) 4 4 1
(D) 8 4 1
(E) 8 4 2
(i)
(ii)
(iii)
(iv)
(C)
(D)
(E)
6.
(B)
#include<stdio.h>
int main(){
7.
(A) Void
(B) Char
(C) float
(D) double
(E)
8.
None of these
#include<stdio.h>
const enum Alpha{
X,
Y=5,
Z
}p=10;
int main(){
enum Alpha a,b;
a= X;
b= Z;
printf("%d",a+b-p);
return 0;
}
Choose all that apply:
(A) -4
(B) -5
(C) 10
(D) 11
(E) Error: Cannot modify constant object
9.
#include<stdio.h>
extern enum cricket x;
int main(){
printf("%d",x);
return 0;
}
const enum cricket{
Taylor,
Kallis=17,
Chanderpaul
}x=Taylor|Kallis&Chanderpaul;
Choose all that apply:
(A) 0
(B) 15
(C) 16
(D) 17
(E) Compilation error
10.
#include<stdio.h>
enum A{
x,y=5,
enum B{
p=10,q
}varp;
}varx;
int main(){
printf("%d %d",x,varp.q);
return 0;
}
11.
#include<stdio.h>
int main(){
int i=5,j;
j=++i+++i+++i;
printf("%d %d",i,j);
return 0;
}
12.
#include<stdio.h>
int main(){
int i=1;
i=2+2*i++;
printf("%d",i);
return 0;
}
13.
#include<stdio.h>
int main(){
int a=2,b=7,c=10;
c=a==b;
printf("%d",c);
return 0;
}
14. What will be output of the following program?
#include<stdio.h>
void main(){
int x;
x=10,20,30;
printf("%d",x);
return 0;
}
15.
#include<stdio.h>
int main(){
int a=0,b=10;
if(a=0){
printf("true");
}
else{
printf("false");
}
return 0;
}
16.
#include<stdio.h>
int main(){
int a;
a=015 + 0x71 +5;
printf("%d",a);
return 0;
}
17.
#include<stdio.h>
int main(){
int x=100,y=20,z=5;
printf("%d %d %d");
return 0;
}
18.
#include<stdio.h>
int main(){
int a;
a=sizeof(!5.6);
printf("%d",a);
return 0;
}
19.
#include<stdio.h>
int main(){
float a;
(int)a= 45;
printf("%d,a);
return 0;
}
20.In the following program where is the variable a getting defined and where it is getting
declared?
#include<stdio.h>
int main()
{
extern int a;
printf("%d\n", a);
return 0;
}
int a=20;
A.
B.
C.
D.
0, 1, 2
B.
1, 2, 3
C.
0, 2, 1
22. What
D.
1, 3, 2
#include<stdio.h>
int main()
{
struct emp
{
char name[20];
int age;
float sal;
};
struct emp e = {"Tiger"};
printf("%d, %f\n", e.age, e.sal);
return 0;
}
A.
0, 0.000000
B.
Garbage values
C.
Error
D.
None of above
20
B.
40
C.
Error
D.
No Output
A.
B.
C.
Error
D.
None of these
Garbage Values
B.
2, 3, 3
C.
3, 2, 2
D.
0, 0, 0
40 40
B.
20 40
C.
20
D.
Error
27. What
A.
use 3.14LD
B.
use 3.14L
C.
use 3.14DL
D.
use 3.14LF
28. Which of the following statement obtains the remainder on dividing 5.5 by 1.3 ?
A.
B.
C.
D.
Infinite times
B.
11 times
C.
0 times
D.
10 times
30. How many times the while loop will get executed if a short int is 2 byte wide?
#include<stdio.h>
int main()
{
int j=1;
while(j <= 255)
{
printf("%c %d\n", j, j);
j++;
}
return 0;
}
A.
Infinite times
B.
255 times
C.
256 times
D.
254 times
&
B.
&&
C.
||
D.
32. Which of the following is the correct order of evaluation for the below expression?
z = x + y * z / 4 % 2 1
A.
/+*-
B.
*-/+
C.
+-/*
D.
/*+-
34. In C, if you pass an array as an argument to a function, what actually gets passed?
A.
B.
C.
D.
30
B.
27
C.
D.
B.
C.
D.
37. What will be the output of the program If the integer is 4bytes long?
#include<stdio.h>
int main()
{
int ***r, **q, *p, i=8;
p = &i;
q = &p;
r = &q;
printf("%d, %d, %d\n", *p, **q, ***r);
return 0;
}
A.
8, 8, 8
B.
C.
D.
-1, 0, 1, 2, 3, 4
B.
-1, 2, 6, 3, 4, 5
C.
-1, 0, 6, 2, 3, 4
D.
-1, 0, 6, 7, 8, 9
39.
};
int main()
{
struct course c[] = { {102, "Java"},
{103, "PHP"},
{104, "DotNet"}
};
103 DotNet
B.
102 Java
C.
103 PHP
D.
104 DotNet
40.
#include<stdio.h>
void main()
{
char *str="CQUESTIONBANK";
clrscr();
printf(str+9);
getch();
}
What will output when you compile and run the above code?
(a)CQESTIONBANK
(b)CQUESTION
(c)BANK
(d)Compiler error
41. What will be output of following c code?
#include<stdio.h>
extern int x;
int main(){
do{
do{
printf("%o",x);
}
while(!-2);
}
while(0);
return 0;
}
int x=8;
#include<stdio.h>
int r();
int main(){
for(r();r();r()) {
printf("%d ",r());
}
return 0;
}
int r(){
int static num=7;
return num--;
}
47. what will be the output ?
#include<stdio.h>
int main(){
int i;
for(i=0;i<=5;i++);
printf("%d",i)
return 0;
}
48. What will be output of following c code?
#include<stdio.h>
int main(){
int x=123;
int i={
printf("c" "++")
};
for(x=0;x<=i;x++){
printf("%x ",x);
}
return 0;
}
49.
What will be output of following code?
#define max 10
void main()
{
int i;
i=++max;
clrscr();
printf("%d",i);
getch();
51.What will
#define A 4-2
#define B 3-1
void main()
{
int ratio=A/B;
printf("%d ",ratio);
getch();
}
code?
following code?
#define M 5
#define N M+1
#define PRINT printf("RITESH");
void main()
{
int volume =CUBE(3+2);
clrscr();
printf("%d %d ",volume,N);
PRINT
getch();
}
55. What will be output when you will execute following c code?
#include<stdio.h>
void main(){
int m=5,n=10,q=20;
if(q/n*m)
printf("William Gates");
else
printf(" Warren Buffet");
printf(" Carlos Slim Helu");
}
Choose all that apply:
(A) William Gates
(B)
56. What will be output when you will execute following c code?
#include<stdio.h>
void main(){
if(!printf("Mukesh Ambani"))
if(printf(" Lakashmi Mittal"));
}
Lakashmi Mittal
(B)
Barack Obama
Hu Jintao
Nicolas Sarkozy
Vladimir Putin
(C)
Barack Obama
Hu Jintao
Nicolas Sarkozy
Ben Bernanke
Vladimir Putin
(D)
Hu Jintao
Nicolas Sarkozy
Vladimir Putin
(E)
Compilation error
58. What will output when you compile and run the above code?
#include<stdio.h>
void main()
{
clrscr();
printf("%d",printf("CQUESTIONBANK"));
getch();
}
(a)13CQUESTIONBANK
(b)CQUESTIONBANK13
(c)Garbage CQUESTIONBANK
(d)Compiler error
59. What will be output when you will execute following c code?
#include<stdio.h>
void main(){
int a=10;
if(printf("%d",a>=10)-10)
for(;;)
break;
else;
}
Choose all that apply:
60. What will be output when you will execute following c code?
#include<stdio.h>
void main(){
int a=5,b=10;
if(++a||++b)
printf("%d %d",a,b);
else
printf("John Terry");
}
Choose all that apply:
(A)
5 10
(B)
6 11
(C)
6 10
(D)
5 11
(E)
John Terry