Table of Contents
C Programming Conditional Statements Questions
Condition statements in C are used almost in every program written in the C programming language. This is a very important concept and a useful building block of programming construct.
Conditional statements in C Programming are used when we have to execute a statement or set of statements on the basis of occurrences of some condition.
Conditional statements are also known as decision control statements.
Conditional statements are also know known as Jump statements some time because they break the sequential execution of the program.
In C Programming there are following conditional statements.
- IF – Simple If , If-else ,If -else if -else , nested if-else
- Switch Case Statements
- Conditional Operator
- Goto statements
To know about syntax and implementation of conditional statements read this tutorial –
Conditional Statements n C Programming
Conditional Statements Questions
In this tutorial we have discuss some questions asked in AKTU University Exam in Previous Years. Such types of questions are also asked in Technical Interview.
Short Questions ( 2 Marks)
Q1. What is Operator ?
Q2. What is Expression ?
Q3. What is Operand ?
Q4. What is the output of this C code? [AKTU 2015-16]
void main()
{
int x = 4;
x = x << 1;
printf(“%d\n”, x);
}
Q5. Why C programming is called structured programming? [AKTU 2015-16]
Q6. What is the value of x for x= -17%-2. [AKTU 2015-16]
Q7. Write down the output of the following. [AKTU 2017-18]
main()
{
int i=1;
for( ; ; )
{
printf(“%d”,i);
if(i= =7)
break;
}
}
Q8. What is type conversion ?
Q9. Differentiate between implicit & Explicit type conversion [AKTU 2019-20]
Q10. What do you understand by mixed mode arithmetic expression? [AKTU 2019-20]
Q11. What is the output of the following code? [AKTU 2021-22]
int a = 6;
b = ++a + a++ – a;
printf(“a=%d, b=%d”,a,b);
Q12. What is the difference between & and && operators? [AKTU 2021-22]
Q13. Write the use of ‘switch’ statement ? [AKTU 2016-17]
Q14.Consider the following code of segment [AKTU 2012-13]
X=1;
Y=1;
if(n>0)
{
x=x+1;
y=y+1;
}
printf(“%d%d”, x, y);
what will be the value of x and y if assume n=1.
Q15. Write the difference between if statement and switch statement. [AKTU 2012-13]
Q16. Write the difference between Logical Operator and Relational Operators. [AKTU 2012-13]
Long Type Questions (10 or 7 marks)
Q11. Explain different types of Operators in C Programming with example.
Q12. Differentiate between precedence of operators and associativity of operators with suitable example [AKTU 2021-22]
Q13. Differentiate between type conversion and type casting. Write a program in C to input a floating-point number and find rightmost digit of this number [AKTU 2021-22]
Q14. What is case control structure in C? What is the reason for using break statement at the end of each case in case control block? Explain with help of example. [ AKTU 2019-20]
Q15. The marks obtained by a student in 5 different subjects are input through keyboard. The student gets a division as per the following rules [AKTU 2019-20]
Percentage >=60 – First Division
Percentage greater than or equal to 50 and less than 60 – Second division
Percentage greater than or equal to 40 and less than 49 – Third division
Percentage less than 40 – Fail
Draw a flow chart and Write a program to calculate the division obtained by the student.
Q16. Write a program in C to understand the working of bitwise and conditional operators [AKTU 2019-20]
Q17. Draw a flow chart and write a program to find greatest number among three distinct numbers. [AKTU 2018-19]
Q18. Write a program that calculate sum of the digits of an integer. For example, the sum of the digit of the number 2155 is 2+1+5+5 or 13.The program should accept any arbitrary number typed by user [AKTU 2016-17]
Q19. What are different conditional statements? [AKTU 2012-13]
Q20. Write the Precedence of different operators used in C Programming. [AKTU 2012-13]
Q21. Explain difference between if and if else statement with an example.
Q22. Explain the use of if – else if – else or if else ladder with an example.
Q23. Explain the use of switch statement with an example.
Q24. What is use of nested if else? Give an example.
Conclusion and Summary
Various C Programming Conditional Statements Questions are given here in this tutorial. Computer science students should prepare these questions very well.