0% found this document useful (0 votes)
13 views3 pages

Data types and operators _ DPP

Uploaded by

livehappy979
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views3 pages

Data types and operators _ DPP

Uploaded by

livehappy979
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

1

Computer Science & Information Technology


Crash Course 2025
C - Programming
Data Types & Operators

Q1 What will be the output of the following code? Q4 What will be the output of the following code?
#include <stdio.h> #include <stdio.h>
int main() int main() {
{ unsigned int a = 45, b = 35;
int x = 10; int result = (a & b) | (a ^ b);
int y = x++ + x++ + x--; printf("%d\n", result);
printf("%d\n", y); return 0;
return 0; }
}
(A) 30 (B) 31
(C) 32 (D) 33 (A) 43 (B) 45
(C) 47 (D) 49
Q2 Consider the following code snippet:
#include <stdio.h> Q5 Consider the following code snippet:
int main() #include <stdio.h>
{ int main()
int a = 5; {
int b = 10; unsigned int x = 7, y = 25;
int c = a++ + b++ + a++ - b--; int result = ~(x << 2) & (y >> 2);
printf("%d\n", c); printf("%d\n", result);
return 0; return 0;
} }
(A) 8 (B) 9 What is the output?
(C) 10 (D) 11
(A) 2 (B) 6
Q3 What will the following code print?
(C) 7 (D) 8
#include <stdio.h>
int main() Q6 What will be the result of the following code?
{ #include <stdio.h>
int i = 3, j = 4; int main()
int k = i++ * j-- + i++ * j--; {
printf("%d\n", k); int a = 100, b = 45;
return 0; int result = (a ^ b) << 3;
} printf("%d\n", result);
(A) 15 (B) 16 return 0;
(C) 17 (D) 24

Android App | iOS App | PW Website

https://qbg-admin.penpencil.co/finalize-question-paper/print-preview 1/3
} return 0;
}

(A) 440 (B) 360


Q9 Consider the following code snippet:
(C) 584 (D) 784
#include <stdio.h>
Q7 Consider the following code: int main()
#include <stdio.h> {
int main() int x = 5, y = 10;
{ int result = (x > 3 && y < 20) || (x++ > 5);
unsigned int x = 34, y = 15; printf("%d %d\n", result, x);
int result = (x & y) ^ (x | y); return 0;
printf("%d\n", result); }
return 0; What is the output of the program?
} (A) 1 5 (B) 0 5
What will be the output of the program? (C) 1 6 (D) 0 6

Q10 What will the following code output?


(A) 15 (B) 30
#include <stdio.h>
(C) 45 (D) 60
int main()
Q8 What will be the output of the following code ? {
#include <stdio.h> int a = 4, b = -3, c = 0;
int main() int result = a || b && c;
{ printf("%d\n", result);
int a = 10, b = 0, c = – 5; return 0;
int result = a && b || c; }
printf("%d\n", result);

Android App | iOS App | PW Website

https://qbg-admin.penpencil.co/finalize-question-paper/print-preview 2/3
Answer Key
Q1 (D) Q6 (C)

Q2 (C) Q7 (C)

Q3 (D) Q8 1

Q4 (B) Q9 (A)

Q5 (A) Q10 1

Android App | iOS App | PW Website

https://qbg-admin.penpencil.co/finalize-question-paper/print-preview 3/3

You might also like