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:
There are 5 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
You don’t know what you have done for us
Lots of thanks🙏