C Program Practice
Enhance your skills with real-world coding challenges and comprehensive word problem solutions for effective learning.
Problem 1 : Reverse a String
Problem Statement: 1. Write a program to reverse a string entered by the user.
Example Input: "hello"
Example Output: "olleh"
Problem 2 : Palindrome Number Check
Problem Statement: Check if a given number is a palindrome.
Example Input: 121
Example Output: Palindrome
Problem 3 : Find GCD of Two Numbers
Problem Statement: Write a program to find the greatest common divisor (GCD) of two numbers.
Example Input: 36, 60
Example Output: 12
Problem 4 : Sum of Digits in a Number
Problem Statement: Write a program to calculate the sum of digits in a number.
Example Input: 1234
Example Output: 10
Problem 5 : Fibonacci Series
Problem Statement: Print the first n terms of the Fibonacci series.
Example Input: 5
Example Output: 0 1 1 2 3
Problem 6: Count Vowels in a String
Problem Statement: Write a program to count the number of vowels in a string.
Example Input: "education"
Example Output: 5
Problem 7: Find the Second Largest Element in an Array
Problem Statement: Write a program to find the second largest element in an array.
Example Input: {12, 35, 1, 10, 34, 1}
Example Output: 34
Problem 8: Employee Salary Slip Generator
Problem Statement: Write a program to calculate the gross salary of an employee. The gross salary is calculated as:
Gross Salary = Basic + HRA + DA
Where:HRA is 20% of Basic Salary
DA is 80% of Basic Salary
Example Input:
Basic Salary: 25000
Example Output:
HRA: 5000, DA: 20000, Gross Salary: 50000
Problem 9 : Electricity Bill Calculator
Problem Statement: Write a program to calculate the electricity bill based on the following tariff:
First 100 units: ₹1.5/unit
Next 200 units: ₹2/unit
Above 300 units: ₹3/unit
Example Input:
Units Consumed: 350
Example Output:
Bill Amount: ₹650
Problem 10: Student Grade Calculator
Problem Statement: Write a program to calculate the grade of a student based on their marks:
Marks >= 90: Grade A
Marks >= 80 and <90: Grade B
Marks >= 70 and <80: Grade C
Marks >= 60 and <70: Grade D
Marks < 60: Grade F
Example Input:
Marks: 85
Example Output:
Grade: B
Problem 11: Currency Denomination Calculator
Problem Statement: Write a program to calculate the minimum number of notes required for a given amount. Consider the denominations: ₹2000, ₹500, ₹200, ₹100, ₹50, ₹20, ₹10, ₹5, ₹1.
Example Input:
Amount: 2673
Example Output:
₹2000: 1, ₹500: 1, ₹100: 1, ₹50: 1, ₹20: 1, ₹1: 3
Problem 12: Banking System - Simple Interest Calculator
Problem Statement: Write a program to calculate the simple interest for a loan. The formula is:
Simple Interest (SI) = (Principal Rate Time) / 100
Example Input:
Principal: 10000
Rate: 5
Time: 2
Example Output:
Simple Interest: ₹1000
Problem 13: Voting Eligibility Checker
Problem Statement: Write a program to check if a person is eligible to vote.
Eligibility Criteria: Age must be 18 or above.
Example Input:
Age: 16
Example Output:
Not Eligible to Vote
Problem 14: Factorial of a Number
Problem Statement: Write a program to calculate the factorial of a number.
Example Input:
Number: 5
Example Output:
Factorial: 120
Empowerment
Advancing careers through education and innovation.
© 2024. All rights reserved.