The document outlines a series of C programming problems that require the use of functions to solve various tasks. These tasks include finding maximum values, checking number properties, validating triangles, calculating grades, and computing salaries and electricity bills based on specified conditions. Each problem is designed to enhance programming skills through practical applications of conditional statements and calculations.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
6 views
2. C Programs Using if – Else Exercise
The document outlines a series of C programming problems that require the use of functions to solve various tasks. These tasks include finding maximum values, checking number properties, validating triangles, calculating grades, and computing salaries and electricity bills based on specified conditions. Each problem is designed to enhance programming skills through practical applications of conditional statements and calculations.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1
Solve the following problems using functions
1. C program to find maximum between three numbers using nested if
2. C program to check positive negative or zero using if else 3. C program to check even or odd number 4. C program to check Leap Year 5. C program to check alphabet, vowel, consonant digit or special character 6. C program to print day name of week 7. C program to print number of days in a month 8. C program to count minimum number of notes in an amount 9. C program to check whether a triangle is valid or not if angles are given 10. C program to check whether a triangle is Equilateral, Isosceles or Scalene (All sides equal-> Equilateral, two sides equal-> Isosceles, all sides are not equal Scalene) 11. C program to find all roots of a quadratic equation 12. Write a C program to input marks of five subjects Physics, Chemistry, Biology, Mathematics and Computer, calculate percentage and grade according to given conditions: If percentage >= 90% : Grade A If percentage >= 80% : Grade B If percentage >= 70% : Grade C If percentage >= 60% : Grade D If percentage >= 40% : Grade E If percentage < 40% : Grade F 13. Write a C program to input basic salary of an employee and calculate gross salary according to given conditions. Basic Salary <= 10000 : HRA = 20%, DA = 80% Basic Salary is between 10001 to 20000 : HRA = 25%, DA = 90% Basic Salary >= 20001 : HRA = 30%, DA = 95% 14. Write a C program to input electricity unit charge and calculate the 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.