Pseudo Code - Normal
Question 1
What will be the output of the following pseudocode?
#include<stdio.h>
main()
{
int n;
n=1,2,3,4,5;
printf("%d",n);
}
Question 1
A) 1
B) 5
C) 12345
D) Compile time error
Question 1
A) 1
B) 5
C) 12345
D) Compile time error
Question 2
What will be the output of the following pseudocode?
#include<stdio.h>
main()
{
int n=(1,2,3,4,5);
printf("%d",n);
}
Question 2
A) 1
B) 5
C) 12345
D) Compile time error
Question 2
A) 1
B) 5
C) 12345
D) Compile time error
Question 3
What will be the output of the following pseudocode?
#include<stdio.h>
main()
{
int n=1,2,3,4,5;
printf("%d",n);
}
Question 3
A) 1
B) 5
C) 12345
D) Compile time error
Question 3
A) 1
B) 5
C) 12345
D) Compile time error
Question 4
What will be the output of the following pseudocode?
#include "stdio.h"
int main()
{
int x, y = 5, z = 5;
x = y == z;
printf("%d", x);
return 0;
}
Question 4
A) 0
B) 1
C) 5
D) Compile time error
Question 4
A) 0
B) 1
C) 5
D) Compile time error
Question 5
What will be the output of the following pseudocode?
#include <stdio.h>
int main()
{
int y = 0;
int x = (~y == 1);
printf("%d", x);
return 0;
}
Question 5
A) 0
B) 1
C) Negative no
D) Compile error
Question 5
A) 0
B) 1
C) Negative no
D) Compile error
Question 6
What will be the output of the following pseudocode?
#include <stdio.h>
int main()
{
printf("%d", 1 << 2 + 3 << 4);
return 0;
}
Question 6
A) 256
B) 52
C) 512
D) 0
Question 6
A) 256
B) 52
C) 512
D) 0
Question 7
What will be the output of the following pseudocode?
#include<stdio.h>
int main()
{
int a = 2,b = 5;
a = a^b;
b = b^a;
printf("%d %d",a,b);
return 0;
}
Question 7
A) 52
B) 25
C) 77
D) 72
Question 7
A) 52
B) 25
C) 77
D) 72
Question 8
What will be the output of the following pseudocode?
# include <stdio.h>
int main()
{
int x = 10;
int y = 20;
x += y += 10;
printf (" %d %d", x, y);
return 0;
}
Question 8
A) 40 20
B) 40 30
C) 30 30
D) 30 40
Question 8
A) 40 20
B) 40 30
C) 30 30
D) 30 40
Question 9
What will be the output of the following pseudocode?
#include <stdio.h>
int main()
{
int a = 0;
a = (a == (a == 1));
printf("%d", a);
return 0;
}
Question 9
A) 0
B) 1
C) Negative no
D) -1
Question 9
A) 0
B) 1
C) Negative no
D) -1
Question 10
What will be the output of the following pseudocode?
#include <stdio.h>
void main()
{
unsigned char c=290;
printf("%d",c);
}
Question 10
A) Error
B) Garbage value
C) 290
D) 34
Question 10
A) Error
B) Garbage value
C) 290
D) 34
Question 11
What will be the output of the following pseudocode?
#include <stdio.h>
int main()
{
int a,b,c;
a=0x10;
b=010;
c=a+b;
printf("\nAddition is= %d",c);
}
Question 11
A) Error
B) Addition is= Garbage value
C) Addition is= 24
D) Addition is= 20
Question 11
A) Error
B) Addition is= Garbage value
C) Addition is= 24
D) Addition is= 20
Question 12
What will be the output of the following pseudocode?
int main()
{
int i=10;
printf(“%d,%d”,++i,++i);
}
Question 12
A) 10,12
B) 11,12
C) 11,11
D) 12,12
Question 12
A) 10,12
B) 11,12
C) 11,11
D) 12,12
Question 13
What will be the output of the following pseudocode?
#include<stdio.h>
int main()
{
int c=08;
printf("%d",c);
return 0;
}
Question 13
A) 08
B) None
C) Error
D) 8
Question 13
A) 08
B) None
C) Error
D) 8
Question 14
What will be the output of the following pseudocode?
#include <stdio.h>
int main()
{
float x = ‘a’;
printf(“%f”, x);
return 0;
}
Question 14
A) a
B) a.000000
C) Error
D) 97.000000
Question 14
A) a
B) a.000000
C) Error
D) 97.000000
Question 15
What will be the output of the following pseudocode?
#include<stdio.h>
#include<conio.h>
int main()
{
int a=26;
printf("%o %0X", a, a);
return 0;
}
Question 15
A) Compile time error
B) Garbage value
C) 32 1A
D) 00
Question 15
A) Compile time error
B) Garbage value
C) 32 1A
D) 00
Question 16
What will be the output of the following pseudocode?
Integer a, b
Set a = 15, b = 7
a = a mod (a – 3)
b = b mod (b – 3)
a = a mod 1
b = b mod 1
Print a + b
Question 16
A) 15
B) 6
C) 2
D) 0
Question 16
A) 15
B) 6
C) 2
D) 0
Question 17
What will be the output of the following pseudocode?
READ INTEGER j=41, k= 37
j=j+1
k=k-1
j=j/k
k=k/j
print(k,j)
Question 17
A) 42 36
B) 36 1
C) 11
D) 1 36
Question 2
A) 42 36
B) 36 1
C) 11
D) 1 36
Question 3
What will be the output of the following pseudocode?
#include
int main()
{
int x=9,y=2,z=6;
int a=x&y|z;
printf("%d",a);
return 0;
}
Question 3
A) 7
B) 5
C) 6
D) Compile error
Question 3
A) 7
B) 5
C) 6
D) Compile error
Question 4
What will be the output of the following pseudocode?
#include <stdio.h>
using namespace std;
int main()
{
printf("%d", 'X' > 'x');
return 0;
}
Question 4
A) 0
B) X
C) x
D) 1
Question 4
A) 0
B) X
C) x
D) 1
Question 5
What will be the output of the following pseudocode?
#include <stdio.h>
int main()
{
int x = 10, y = 20, z = 30;
z = x = y;
printf("%d", z);
return 0;
}
Question 5
A) 10
B) 30
C) Error
D) 20
Question 5
A) 10
B) 30
C) Error
D) 20
Question 6
What will be the output of the following pseudocode?
#include <stdio.h>
int main()
{
int x = 210;
int y = 0;
;
;
printf("%d", y);
;
;
return 0;
}
Question 6
A) 0
B) 210
C) Runtime Time Error
D) Compile Time Error
Question 6
A) 0
B) 210
C) Runtime Time Error
D) Compile Time Error
Question 7
What will be the output of the following pseudocode?
#include <stdio.h>
int main()
{
typedef int score;
score result = 0.00;
printf("%d", result);
return 0;
}
Question 7
A) 0.0
B) 0.00
C) 0.000000
D) 0
Question 7
A) 0.0
B) 0.00
C) 0.000000
D) 0
Question 8
What will be the output of the following pseudocode?
#include <stdio.h>
int main()
{
int any = ' ' * 10;
printf("%d", any);
return 0;
}
Question 8
A) 10
B) Compile Error
C) 320
D) Runtime Error
Question 8
A) 10
B) Compile Error
C) 320
D) Runtime Error
Question 9
What will be the output of the following pseudocode?
#include <stdio.h>
int main()
{
int b = 80;
char a= (char)b;
int i=sizeof(a);
printf("%d",i);
}
Question 9
A) 1
B) 80
C) 2
D) 4
Question 9
A) 1
B) 80
C) 2
D) 4
Question 10
What will be the output of the following pseudocode?
#include <stdio.h>
int main()
{
printf("%f", main);
return 0;
}
Question 10
A) 0
B) 0.0
C) 0.000000
D) Compile time error
Question 10
A) 0
B) 0.0
C) 0.000000
D) Compile time error
Question 11
What will be the output of the following pseudocode?
#include <stdio.h>
int main()
{
float i;
i = 1;
printf("%d", i);
return 0;
}
Question 11
A) Garbage Value
B) 1
C) 0
D) Error
Question 11
A) Garbage Value
B) 1
C) 0
D) Error
Question 12
What will be the output of the following pseudocode?
#include <stdio.h>
int main()
{
int get_the_val;
get_the_val = (100, 256, 3.3);
printf("%d", get_the_val);
return 0;
}
Question 12
A) 3
B) 3.3
C) 100
D) 256
Question 12
A) 3
B) 3.3
C) 100
D) 256
Question 13
What is the intention of the following pseudocode?
integer a,b,c,x,y,z,p,q,r;
Set x=5,y=10,z=15;
Set p=10,q=20,r=30;
a=x+p;
b=y*q;
c=r/z;
Print a b c
Question 13
A) 15 200 0
B) 15 200 20
C) 15 200 2
D) 15 20 2
Question 13
A) 15 200 0
B) 15 200 20
C) 15 200 2
D) 15 20 2
Question 14
What will be the output of the following pseudocode?
#include<stdio.h>
int main ()
{
int x = 4, y = 0;
int z;
z = (x++ + ++y + y++ , ++x);
printf ("%d\n", z);
return 0;
}
Question 14
A) 5
B) 0
C) Compile time error
D) Undefined behavior due to the order of evaluation can be different
Question 14
A) 5
B) 0
C) Compile time error
D) Undefined behavior due to the order of evaluation can be different
Question 15
What will be the output of the following pseudocode?
#include <stdio.h>
int main ()
{
int x = 5, y = 4, z = 3;
int a = x<<+1;
int b= y>>+1;
int c = z<<+1;
printf ("%d\n", a);
printf ("%d\n", b);
printf ("%d\n", c);
return 0;
}
Question 15
A) Error
B) 10 8 6
C) 10 2 6
D) 10 2 4
Question 15
A) Error
B) 10 8 6
C) 10 2 6
D) 10 2 4
Question 16
What will be the output of the following pseudocode?
#include<stdio.h>
int main()
{
fprintf(stdout,"Get Placed");
}
Question 16
A) Error
B) Garbage Value
C) Get Placed
D) Nothing gets printed
Question 16
A) Error
B) Garbage Value
C) Get Placed
D) Nothing gets printed
Question 17
What will be the output of the following pseudocode?
#include<stdio.h>
int main()
{
int i = 065,j = 65;
printf("%d,%f",i,j);
}
Question 17
A) 065,65
B) 53,0.000000
C) 65,65
D) Error
Question 17
A) 065,65
B) 53,0.000000
C) 65,65
D) Error
Question 18
What will be the output of the following pseudocode?
#include <stdio.h>
int main()
{
int p,q=105;
p=printf("%d ",q);
printf("%d",p);
}
Question 18
A) 105 4
B) 105 3
C) Error
D) 105 0
Question 18
A) 105 4
B) 105 3
C) Error
D) 105 0
Question 19
What will be the output of the following pseudocode?
#include<stdio.h>
int main()
{
int i=-3, j=2, k=0, m;
m = ++i && ++j && ++k;
printf("%d, %d, %d, %d\n", i, j, k, m);
return 0;
}
Question 19
A) -2 3 1 1
B) 2311
C) -2 3 1 0
D) 3310
Question 19
A) -2 3 1 1
B) 2311
C) -2 3 1 0
D) 3310
Question 20
What will be the output of the following pseudocode?
#include<stdio.h>
int main()
{
int i=4, j=-1, k=0, w, x, y, z;
w = i || j || k;
x = i && j && k;
y = i || j &&k;
z = i && j || k;
printf("%d, %d, %d, %d\n", w, x, y, z);
return 0;
}
Question 20
A) 1, 1, 1, 1
B) 1, 1, 0, 1
C) 1, 0, 1, 1
D) 1, 0, 0, 1
Question 20
A) 1, 1, 1, 1
B) 1, 1, 0, 1
C) 1, 0, 1, 1
D) 1, 0, 0, 1
Question 21
What will be the output of the following pseudocode?
#include<stdio.h>
int main()
{
int i=3;
i = i++;
printf("%d\n", i);
return 0;
}
Question 21
A) 3
B) 4
C) 5
D) 6
Question 21
A) 3
B) 4
C) 5
D) 6
Question 22
What will be the output of the following pseudocode?
Integer a
String str1
Set str1 = “goose”
a = stringLength(str1)
Print (a ^ 1)
[Note- string-length(): string-length() function counts the number of characters in a given string and return
the integer value.
^ is the bitwise exclusive OR operator that compares each bit of its first operand to the corresponding bit
of its equal operand. If one bit is 0 and the other bit is 1, the corresponding result bit is set to 1. Otherwise,
the corresponding result bit is set to 0]
Question 22
A) 0
B) 4
C) 5
D) 3
Question 22
A) 0
B) 4
C) 5
D) 3
Question 23
What will be the output of the following pseudocode?
Integer a, b, c
Set a = 8, b = 51, c = 2
c = (a ^ c)^ (a)
b = b mod 4
Print a + b + c
Question 23
A) 13
B) 17
C) 26
D) 16
Question 23
A) 13
B) 17
C) 26
D) 16
Question 24
What will be the output of the following pseudocode?
Integer x, y, z
Set x=24, y=8
x = x/y
z = y<<x
Print z
Question 24
A) 1
B) 8
C) 32
D) 64
Question 24
A) 1
B) 8
C) 32
D) 64
Question 25
What will be the output of the following pseudocode?
Integer a=5, b=4, c=3
a=b+c
c=a–b
c=c+a
c=b+c
b=b+c
Print a, b, c
Question 25
A) 7 14 7
B) 7 14 10
C) 7 8 14
D) 7 18 14
Question 25
A) 7 14 7
B) 7 14 10
C) 7 8 14
D) 7 18 14
Question 26
What will be the output of the following pseudocode?
String str1="Qoq", str2="oqo"
print(count Vowel(lower(lower(str1)+lower(str2)+lower(str1))))
Question 26
A) 12
B) 2
C) 0
D) 4
Question 26
A) 12
B) 2
C) 0
D) 4
Question 27
What will be the output of the following pseudocode? Infosys 23-01-2022
Integer x=196, y=85
Integer z
y+=1
x-=10
z=x-y
print(z)
Question 27
A) 100
B) 99
C) 111
D) 65
Question 27
A) 100
B) 99
C) 111
D) 65
Question 28
What will be the output of the following pseudocode?
#include <stdio.h>
int main()
{
int a = 1;
int b = 1;
int c = a || --b;
int d = a-- && --b;
printf("a =%d, b =%d, c =%d, d =%d",a,b,c,d);
return 0;
Question 28
A) a=0, b=1, c=1, d=0
B) a=0, b=0, c=1, d=0
C) a=1, b=1, c=1, d=1
D) a=0, b=0, c=0, d=0
Question 28
A) a=0, b=1, c=1, d=0
B) a=0, b=0, c=1, d=0
C) a=1, b=1, c=1, d=1
D) a=0, b=0, c=0, d=0
THANK YOU