Here are the some programs based on the decision control statements like if , else , nested if else and switch statement. I am giving you some program for the practice topic wise .I am also giving you some MCQS questions based on these topics .So after solving these questions your doubts will be clear related to these topic.
C Programs based on decision control (if and else):-
1.Write a C program to find maximum between two numbers.
2.Write a C program to find maximum between three numbers.
3.Write a C program to check whether a number is negative, positive or zero.
4.Write a C program to check whether a number is divisible by 5 and 11 or not.
5.Write a C program to check whether a number is even or odd.
6.Write a C program to check whether a year is leap year or not.
7.Write a C program to check whether a character is alphabet or not.
C Program based on switch case:-
1.Using switch statement Write a C program to input marks of five subjects Physics, Chemistry, Biology, Mathematics and Computer. Calculate percentage and grade according to following:
Percentage >= 90% : Grade A
Percentage >= 80% : Grade B
Percentage >= 70% : Grade C
Percentage >= 60% : Grade D
Percentage >= 40% : Grade E
Percentage < 40% : Grade F
2.C Program to find the maximum between two numbers. Using the switch statement
3. C Program to find the maximum between three numbers. Using the switch statement.
4.C Program to check whether a number is divisible by 5 and 11 or not. Using the switch statement.
5.C Program to check whether a year is a leap year or not. Using switch statement
1) Choose a C Conditional Operator from the list.
2) What is the other name for C Language ?: Question Mark Colon Operator.?
A) Comparison Operator
B) If-Else Operator
C) Binary Operator
D) Ternary Operator
3) Choose a syntax for C Ternary Operator from the list.
A) condition ? expression1 : expression2
B) condition : expression1 ? expression2
C) condition ? expression1 < expression2
D) condition < expression1 ? expression2
4) What is the output of the C statement.?
a = 5<2 ? 4 : 3;
5) What is the output of C Program.?
a = printf(“4”);
B) compiler error
Click on the given links for the questions:-
- Very Cool numbers | Hacker earth solution
- Vowel Recognition | Hackerearth practice problem solution
- Birthday party | Hacker earth solution
- Most frequent | hacker earth problem solution
- program to find symetric difference of two sets
- cost of balloons | Hacker earth problem solution
- Chacha o chacha | hacker earth problem solution
- jadu and dna | hacker earth solution
- Bricks game | hacker earth problem
- Anti-Palindrome strings | hacker earth solution
- connected components in the graph | hacker earth data structure
- odd one out || hacker earth problem solution
- Minimum addition | Hackerearth Practice problem
- The magical mountain | Hackerearth Practice problem
- The first overtake | Hackerearth Practice problem
- Playing With Characters | Hackerrank practice problem solution
- Sum and Difference of Two Numbers | hackerrank practice problem solution
- Functions in C | hackerrank practice problem solution
- Pointers in C | hackerrank practice problem solution
- Conditional Statements in C | Hackerrank practice problem solution
- For Loop in C | hackerrank practice problem solution
- Program to find cycle in the graph
- Implementation of singly link list
- Implementation of queue by using link list
- Algorithm of quick sort
- stack by using link list
- program to find preorder post order and inorder of the binary search tree
- Minimum weight of spanning tree
- Preorder, inorder and post order traversal of the tree
- How to set limit in the floating value in python
- What is boolean data type
- How to print any character without using format specifier
Must check this:-