GATE CS 2022 | Question 44
Programming & Data Structures › Basics & Control Structures · MCQ · 2 marks · Answer: A
- Question 44Programming & Data Structuresmcq2 marksWhat is printed?
char a='P', b='x'; char c=(a&b)+'*'; char d=(a|b)-'-'; char e=(a^b)+'+'; printf("%c %c %c", c, d, e);(ASCII: P=80, x=120, *=42, -=45, +=43)- A.z K S✓
- B.122 75 83
- C.* - +
- D.P x +
Answer: A
Solution
Answer: (A) z K S ASCII: P=80 (01010000), x=120 (01111000). - ; 'z'. - ; 'K'. - ; 'S'. Printed as characters: "z K S". - A.
More GATE PYQ on Basics & Control Structures
All GATE CS Programming & Data Structures PYQ →Attempt GATE CS 2022 in real GATE exam mode
Full paper with a timer, the GATE interface and a topic-wise analysis — free.
Create free account →