#include
int main()
{
long double a;
long double b;
int arr[sizeof(!a+b)];
printf(“%d”,sizeof(arr));
}
A. Run time Error
B. 32
C. 64
D. No output
C
READ x =4, y = 0;
READ z;
z = (y++, y);
WRITE z
A. 1
B. 0
C. Undefined Behavior due to order of evaluation can be different.
D. Compilation Error
A
READ ch value between 1 & 2
switch(ch, ch+1)
case 1 :
WRITE “1”
break;
case 2 :
WRITE “2”
break;
default :
WRITE “3”
A. 1
3
B. Error : Undefined condition in switch
C. 1
D. No output
C
What is the output of given code for input 134 :
FUNCTION fun1(INPUT num)
{
static int a =0;
IF (num>0)
a=a+1;
fun1(num/10);
ELSE
return a;
END FUNCTION
A. 2
B. 3
C. Runtime Error
D. None of these
B
What will be output of given pseudo code for input 7 :
1. read the value of n
2. set m=1,t=0
3. if m >= n
4. go to line 9
5. else
6. t=t+m
7. m+=1
8. go to line 3
9. display T
10. stop
A. 32
B. 76
C. 28
D. 21
D
READ n=2
FUNCTION fun(int n)
IF(n == 4)
return n;
ELSE
return 2*fun(n+1);
A. 4
B. 8
C. 16
D. Error
C
What will be output of given pseudo code :
int i=5, j=7;
if ( i+j> 5)
j = i+2;
if ( j<5 )
print(i)
else
print(j)
else
print(i+1)
A. 12
B. 5
C. 7
D. 6
C
What will be output of given pseudo code :
READ INTEGER j=41, k= 37
j=j+1
k=k-1
j=j/k
k=k/j
print(k,j)
A. 42 36
B. 36 1
C. 1 1
D. 1 36
B
#include<stdio.h>
using namespace std;
int main()
{
int a =0,b=1,c=2;
*( ( a+1==1) ? &b : &a)= a? b : c;
printf(“%d, %d, %d \n”, a , b, c );
return 0;
}
A. 0 1 2
B. 0 2 0
C. 0 2 2
D. Error
C
What will be the output of the given pseudocode for s1=3 and e1=6?
READ s1,e1
FUNCTION num(INT s1,INT e1)
IF(s1==e1)
RETURN s1
ELSE
RETURN s1+num(s1+1,e1)
ENDIF
END FUNCTION
A.12
B.15
C.18
D.6
C