Arithmetic Operation: GATE CS Previous Year Questions

Arithmetic Operation · Programming in C

6 questions · asked in 6 of 27 years (2000–2026)

MCQ 4 · NAT 21-mark 3 · 2-mark 3

2000Questions per year2026

Questions 1–5 of 6

Q1GATE 2024 (Session 1)1 markMCQ−0.33 if wrong
Consider the following C program:

#include <stdio.h>
int main(){
int a = 6;
int b = 0;
while(a < 10) {
a = a / 12 + 1;
a += b;}
printf("%d", a);
return 0;}
Which one of the following statements is CORRECT?

Q2GATE 20222 marksMCQ−0.67 if wrong
What is printed by the following ANSI C program?
#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
ABC...Z 656667...90 abc...z 979899...122 *+ 424345

Q3GATE 2017 (Session 2)2 marksNAT
Consider the following C program.
 #include <stdio.h>
int main ( ) {
    int m = 10;
    int n, n1;
    n = ++m;
    n1 = m++;
    n--;
    --n1;
    n-=n1;
printf ("%d", n) ;
return 0;
}
The output of the program is ______________.

Q4GATE 2016 (Session 1)2 marksNAT
The attributes of three arithmetic operators in some programming language are given below.
Operator Precedence Associativity Arity +HighLeftBinary MediumRightBinary *LowLeftBinary
The value of the expression 2-5+1-7*3 in this language is_______ .

Q5GATE 2014 (Session 2)1 markMCQ−0.33 if wrong
Suppose n and p are unsigned int variables in a C program. We wish to set p to nC3^nC_3. If n is large, which one of the following statements is most likely to set p correctly?

Keep practising

Topics in Programming in C

All CS topics ›