Please Turn On Java Script To Access This Site.

C Institute | Questions


Previous Topic : Assignment Operator - 2Next Topic : Increment Decrement Operator - 2

This section on C interview questions, tricky questions, and puzzles focuses on “Increment Decrement operator”. One shall practice these questions and puzzles to improve their C programming skills needed for various interviews (campus interviews, walk-in interviews, viva exams and company interviews), placements, entrance exams and other competitive exams. These programming questions can be attempted by anyone focusing on learning C Programming language. They can be a beginner, fresher, engineering graduate, engineering student, bca student, mca student, mcs students or an experienced IT professional. Here is a listing of C questions and puzzles on “Increment Decrement operators” along with answers and/or explanations.

Q1: Increment and Decrement Operators are ___________ operators.
a)  Binary
b)  Ternary
c)  Unary
d)  None of these
Correct Answer : c
Explanation : Increment decrement operators are Unary operators.


Q2: For which of the following, ++a code will fail?
a)  int a=10;
b)  char a=10;
c)  float a=10.5;
d)  #define a 10
Correct Answer : d
Explanation : Increment Decrement operators can not be applied on constants and macros.


Q3: What will be the output of following program ?
#include <stdio.h>
void main()
{   
    printf("value is = %d",(10++));
}
a)  10
b)  11
c)  9
d)  Syntax Error
Correct Answer : d
Explanation : Increment and decrement operators can be applied only on variables, they cannot be applied on literals.
Learn C From Scratch


Previous Topic : Assignment Operator - 2Next Topic : Increment Decrement Operator - 2