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. Solution
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.
8.Write a C program to input any alphabet and check whether it is vowel or consonant.
9.Write a C program to input any character and check whether it is alphabet, digit or special character.
10.Write a C program to check whether a character is uppercase or lowercase alphabet.
11.Write a C program to input week number and print week day.
12.Write a C program to input month number and print number of days in that month.
13.Write a C program to count total number of notes in given amount.
14.Write a C program to input angles of a triangle and check whether triangle is valid or not.
15.Write a C program to input all sides of a triangle and check whether triangle is valid or not.
16.Write a C program to check whether the triangle is equilateral, isosceles or scalene triangle.
17.Write a C program to find all roots of a quadratic equation. Solution
18.Write a C program to calculate profit or loss.
19.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
20.Write a C program to input basic salary of an employee and calculate its Gross salary according to following:
Basic Salary <= 10000 : HRA = 20%, DA = 80%
Basic Salary <= 20000 : HRA = 25%, DA = 90%
Basic Salary > 20000 : HRA = 30%, DA = 95%
21.Write a C program to input electricity unit charges and calculate total electricity bill according to the given condition:
For first 50 units Rs. 0.50/unit
For next 100 units Rs. 0.75/unit
For next 100 units Rs. 1.20/unit
For unit above 250 Rs. 1.50/unit
An additional surcharge of 20% is added to the bill
<<Pre - Decision making construct (if and else)) Next - Switch Case in C >>
Recommended Post:
Hackerearth Problems:-
- 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
0 Comments