Data Types and Operator _ DPP 01
Data Types and Operator _ DPP 01
GATE
Q1 Which of the following is not a valid identifier? (C) Operators (D) Expressions
(A) main (B) sizeof
Q7 Any number with fractional part is said to
(C) _PW (D) _PW_
be ________
Q2 Which of the following is not a keyword? (A) Integer Constant
(A) goto (B) volatile (B) Real Constant
(C) main (D) unsigned (C) Character Constant
(D) String Constant
Q3 What is the output of below C Code?
void main() Q8 What will be the output of below 'C' code?
{ void main()
int a=7,b=5,c,d; {
c= a++ + ++b; int i=+17, j=-7;
d= --b + a--; printf("%d,%d", i/j, i%j);
printf("%d %d", d, c); }
} (A) –2, +3
(A) 13, 12 (B) 12, 12 (B) +2, –3
(C) 12, 13 (D) 13, 13 (C) +2, +3
(D) -2, –3
Q4 The output of below C code is ______
void main() Q9 Identify the correct Precedence of below
{ operators:
int i=9, j=12, k, x; (I) ++ (Postfix)
k=i=j; (II) && (Logical AND)
x=i==j; (III) ^(Bitwise XOR)
printf("%d %d", k, x); (IV) >> (Right Shift)
} (A) I, II, III, IV
(A) 9, 12 (B) 12, 1 (B) I, III, II, IV
(C) 12, 0 (D) 9, 0 (C) I, IV, II, III
(D) I, IV, III, II
Q5 The smallest individual element of any 'C'
program is called as _________ Q10 Match the following:
(A) Variables LIST - I LIST - II
(B) Constants A. || 1. Relational
(C) Tokens
B. != 2. Unary
(D) Keywords
C. +(sign) 3. Bitwise
Q6 Which of the below is not a 'C' Token? (A) A-2, B-3, C-1
(A) Identifiers (B) Keywords (B) A-3, B-2, C-1
https://qbg-admin.penpencil.co/finalize-question-paper/print-preview 1/5
1/27/25, 10:12 PM GATE_Computer Science & Information Technology_DPP 1
GATE
https://qbg-admin.penpencil.co/finalize-question-paper/print-preview 2/5
1/27/25, 10:12 PM GATE_Computer Science & Information Technology_DPP 1
GATE
Answer Key
Q1 (B) Q9 (D)
https://qbg-admin.penpencil.co/finalize-question-paper/print-preview 3/5
1/27/25, 10:12 PM GATE_Computer Science & Information Technology_DPP 1
GATE
https://qbg-admin.penpencil.co/finalize-question-paper/print-preview 4/5
1/27/25, 10:12 PM GATE_Computer Science & Information Technology_DPP 1
GATE
The correct matching is: Next, addition and subtraction are performed
A. || - 1. Relational from left to right:
B. != - 2. Unary 7 + 10 = 17
C. +(sign) - 3. Bitwise the correct match is: c. A-3, 17 - 2 = 15
B-1, C-2 So, the value of x is 15.
The operator associativity that is Right to Left is: Q14 Text Solution:
c. Prefix, Unary Operators The code uses nested ternary operators. Since i is
Q12 Text Solution: non zero (true), it evaluates the expression after
https://qbg-admin.penpencil.co/finalize-question-paper/print-preview 5/5