Question 1 |
What is printed by the following ANSI C program?
ASCII encoding for relevant characters is given below

#include < stdio.h >
int main(int argc, char *argv[]){
char a = 'P';
char b = 'x';
char c = (a & b) + '*';
char d = (a | b) - '-';
char e = (a ^ b) + '+';
printf("%c %c %c \n", c, d, e);
return 0;
}
ASCII encoding for relevant characters is given below

z K S | |
122 75 83 | |
* - + | |
P x + |
Question 1 Explanation:
Question 2 |
Consider the following C program:
#include < stdio.h >
int main() {
float sum = 0.0, j = 1.0, i = 2.0;
while (i / j > 0.0625) {
j = j + j;
sum = sum + i/j;
printf("%f \n", sum);
}
return 0;
}
The number of times variable sum will be printed When the above program is executed is _________ .0 | |
3 | |
6 | |
5 |
Question 2 Explanation:
Question 3 |
Consider the following C program:
main()
{
float sum= 0.0, j=1.0,i=2.0;
while(i/j>0.001){
j=j+1;
sum=sum+i/j;
printf("%f/n", sum);
}
}
0 - 9 lines of output | |
10 - 19 lines out output | |
20 - 29 lines of output | |
More than 29 lines of output |
Question 3 Explanation:
Question 4 |
Consider the following C code segment:
#include < stdio.h >
main()
{
int i, j, x;
scanf("%d", &x);
i=1; j=1;
while (i<10) {
j =j*i;
i= i+1;
if(i==x) break;
}
}
For the program fragment above, which of the following statements about the variables i and j must be true after execution of this program? [ !(exclamation) sign denotes factorial in the answer](j=(x-1) !) \wedge(i \geq x) | |
(j=9 !) \wedge(j=10) | |
((j=10 !) \wedge(i=10)) \vee((j=(x-1) !) \wedge(i=x)) | |
(j=9 !) \wedge(i \geqslant 10)) \vee((j=(x-1) !) \wedge(i=x)) |
Question 4 Explanation:
Question 5 |
What does the following program do when the input is unsigned 16 bit integer?
#include < stdio.h >
main(){
unsigned int num;
int i;
scanf("%u", &num);
for(i=0;i<16;i++){
printf("%d", (num < < i&1 < < 15)?1:0);
}
}
It prints all even bits from num
| |
It prints all odd bits from num | |
It prints binary equivalent of num | |
None of above |
Question 5 Explanation:
Question 6 |
Consider the following C program.
#include < stdio.h >
int main ( ) {
int m = 10;
int n, n1;
n = ++m;
n1 = m++;
n--;
--n1;
n-=n1;
printf ("%d", n) ;
return 0;
}
The output of the program is ______________.10 | |
11 | |
1 | |
0 |
Question 6 Explanation:
Question 7 |
The attributes of three arithmetic operators in some programming language are given below.
The value of the expression 2-5+1-7*3 in this language is_______ .

The value of the expression 2-5+1-7*3 in this language is_______ .
-23 | |
9 | |
-27 | |
23 |
Question 7 Explanation:
Question 8 |
Consider the following statements
#define hypotenuse (a, b) sqrt (a*a+b*b);
The macro call hypotenuse(a+2,b+3);Finds the hypotenuse of a triangle with sides a+2 and b+3 | |
Finds the square root of (a+2)^{2} and (b+3)^{2} | |
Is invalid | |
Find the square root of 3*a+4*b+5 |
Question 8 Explanation:
Question 9 |
The for loop
for (i=0; i<10; ++i)
printf("%d", i&1);
prints0101010101 | |
0111111111 | |
0000000000 | |
1111111111 |
Question 9 Explanation:
Question 10 |
Consider the following program fragment
i=6720; j=4;
while (i%j)==0
{
i=i/j;
j=j+1;
}
On termination j will have the value4 | |
8 | |
9 | |
6720 |
Question 10 Explanation:
There are 10 questions to complete.
Dear Practise paper Team,
This website is extremely useful to solve PYQs.
But only if it had an option of bookmarking the question, We could completely depend on this website for PYQs.
As you know, How important it is to mark the important questions. so that we can solve it again later.
I humbly request the team to add this feature by making user accounts.
Thanks & Warm Regards
It would be very useful. Right now i have to make word files to save questions.
Totally agreed with @Praveen Parasar