49.What will be the output?
Void main()
{
char *str1=’powla’ char *str2=’er’ clrscr();
printf("%s \ b \ b%s",str1,str2);
}
(A) powlaer (B) powler
50. What will be output?
Void main()
{
int a=270; char *p; p=(char *)&a; c1rscr();
printf("%d", *p);
getch();
}
(D) 19
(C) power (D) None
(A) 200
Answer :
(C) 14 (B) 16 (D) 15
1. C
|
2. D
|
3.D
|
4.B
|
5. C
|
6. D 7.C
|
8.A
|
9.A 10.C 11.D 12. B
|
13.B
|
14.C
|
15.A
|
16.B
|
17.D
|
18.B
|
19. C 20.A
|
21. B
|
22. A 23.C 24.B 25. D
|
26.D
|
27.C
|
28.D
|
29. B
|
30. D
|
31. A
|
32. B 33.C
|
34.A
|
35.D 36.A 37.C
|
38.B
|
39.D 40. C 41. A 42. C 43.B 44.D 45.A 46.D 47.C 48.A 49.C 50.C
1. what is the output of following?
void main()
{
int a=5;
{
}
clrscr(); printf(“%d” a) getch();
}
(A) 7 B) 5
2. what will be the output?
void main()
{
c) 8 D) 6
int a=5;
{
}
clrscr();
int a=7; a++; printf(“%d” a)
printf(“%d” a)
getch();
}
(A) 5
(B) 7 (C) 8
(D) None
because the scope of variable int a=7 is close after a++ and printf stateme.
3. What is output?
void change(int const*p)
{
*((int *)p) = 20;
}
void main()
{ int const x=10; change(&x); clrscr(); printf("%d",x);
getch(); }
(A) 20 (B) 10 (C) 15 (D) 40
Prepared By:- Mr. Pawar A. B.
112
4. What is output?
void main()
{
int a=1;
static int count; clrscr(); count++; while(a)
{
count++;
a&=a-l;
} printf("%d",count); getch();
}
(A) 20 (B) 1 (C) 16 (D) None
5. What will be the output?
void main()
{ int array[]={1,2,3,4,5,6};
void xxx(int[5]); xxx(arr); getch();
}
void xxx(int ch[5])
{
clrscr();
printf("%d",1 [ch]);
}
(A) 20 (B)l (C) 16 (D) None
6. find(int x, int y)
{
retur((x<y):0:(xy));
}
call using find(x,find(x,y));
The purpose of the code is to find
(A) Maximum of x and y
(B) Minimum of x,y
(C) Positive difference between x and y
(D) Sum of x and y
7.Integer needs 2 bytes, the maximum value it can hold as unsigned is?
(A) (2 power 16)-1 (B) (2 power 15)-1
(C) (2 power 16) (D) (2 power 15)
8.Expression 3*(y-8)/9 and (y-8/9)*3 yields same value and y is of integer then y
Must yield same value (B) Must yield different value
(C) Mayor may not yield same value (D) None
Prepared By:- Mr. Pawar A. B.
(A)
113
9.printf("%f”,9/5)
will print
(A) 1.8 (B) 1.0 (C) 2.0 (D) None (Error)
10. What will Output of Following Program
if(a=7)
printf(“a is 7”)
else
printf(“a is not 7”)
(A)a is 7 (B) is not 7 (C )Nothing (D)Garbag
11. What will Output of Following Program
if(a>b)
if(b>c)
s1;
else
s2;
s2 will be executed if
(A) b>c
(B) a<=b
(C) b<=c and a<=b
(D) a>b and b<=c
12. What will Output of Following Program void main()
{
}
inc()
{
}
inc();inc();inc();
static int x;
printf("%d",++x);
(A) 012 (C) 123
13. Preprocessing is done
(B) 3
(D) 111
(A)either before or at beginning of compilation process
(B) after compilation before execution
(C)after loading
(D) None
14. printf("%d",sizeof("")); will print
(A) 1 (B) Error
(C) 0 (D) Garbage
15.
main()
{
What will Output of Following Program
int a=5,b=2;
Prepared By:- Mr. Pawar A. B.
114
printf("%d" ,a ++ + b);
}
(A) results in syntax (B) 8
(C) 7 (D) None
16.The process by which one bit pattern is converted in to another by bit wise operation
(A) Masking
(C) Bitting .
(B) Pruning
(D) Chopping
17. Value of automatic variable that is declared but not initialized will be
(A) 0
(C) Unpredictable
(B) 1
(D) None
18. int v=3, *pv=&v; printf("%d%d",v, *pv);
output will
be
(A) Error
(C) None
(B) 3 3
(D) 3 address ofv
19.
enum
declaration
cities(Bethlehem,J ericho,N azareth =1,jeruslem}
assign value 1 to
(A) Bethlehm (B) nazareth (C) Bethlehem and nazareth (D) Jerich() and nazareth
21.Consider scanf and sscanf function which is true
(A) no standard function called sscanf
(B) sscanf input character are taken from string
(C) sscanf is equivalent to scanf
(D) None of above
Share with your friends: |