🔢 Types, Operators & Expressions
Why it matters: Every output question depends on exact integer behaviour: wrap-around, integer division, precedence, side effects, and bitwise tricks.
Subtopics
Each subtopic has its own page: idea, why, how, example, play, check. Mark each one understood when it clicks. 0 of 5 done.
Formulas
What GATE asks from this
Question types seen repeatedly in past papers. More stars means more frequent.
Ratings are approximate, based on recurring patterns in past GATE CSE papers.
Previous year questions
2 real questions from the official GATE CSE papers (2022 to 2024), newest first, each with the official answer key and a worked solution. Questions are the property of the GATE organising institutes; this copy is for your personal study.
2 questions · 0 correct of 0 attempted · marks 0 / 4
int f(int x, int y) {
for (int i=0; i<y; i++) {
x=x+x+y;
}
return x;
}Which of the following statements is/are TRUE about the above function?One or more options may be correct. Select all that apply, then submit.
#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;
}Common traps
strlen(a) - strlen(b) > 0 is true whenever a ≠ b in length.x & 1 == 0 means x & (1 == 0).