GATEverse Practice, past papers & mock tests
GATE 2022
Programming & Data StructuresProgramminghardMCQ2 marks
What is printed by the following ANSI C program?
c
#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: A=65,B=66,C=67,...,Z=90; a=97,b=98,c=99,...,z=122; *=42, +=43, -=45.
Save your progress

Related Programming & Data Structures PYQs