Website can be closed on 12th to 14th Jan 2025 due to server maintainance work.
You can Practice C – Language by solving these problems.
Decision-Making and Control Statements
- Odd or Even with Zero Check
Write a program to check if a number is odd, even, or zero usingif-else
. - Traffic Light Simulator
Simulate traffic lights using aswitch-case
. Take user input (R
for red,G
for green,Y
for yellow) and display appropriate actions. - Eligibility for Voting
Input age and check if a person is eligible to vote. Extend the program to determine if the person is eligible for senior citizen benefits (age 60+). - Simple Calculator
Create a calculator program using aswitch-case
that performs addition, subtraction, multiplication, and division based on user choice.
Loops and Iterations
- Sum of Multiples
Find the sum of all multiples of 3 or 5 below a number entered by the user using afor
loop. - Number Palindrome Checker
Input a number and check if it is a palindrome (reads the same forward and backward) using awhile
loop. - Pattern Printing
Print the following pattern forn
rows:1 12 123 1234
- Factorial Without Recursion
Calculate the factorial of a number using awhile
loop instead of recursion.
Functions and Recursion
- Power Function
Write a function to compute the power of a number (base^exponent) using a loop. - Palindrome String
Input a string (without using arrays, take character-by-character input) and check if it is a palindrome using a recursive function. - Number of Digits
Write a recursive function to count the number of digits in an integer. - HCF (Highest Common Factor)
Implement a function to calculate the HCF of two integers using loops.
Logical and Relational Operators
- Magic Number
A “magic number” is a number where the sum of its digits, repeated until a single digit, equals 1. Write a program to check if a number is magic. - Print ASCII Values
Write a program to print all ASCII values for characters from ‘A’ to ‘Z’ using afor
loop. - Nested Loops – Square Pattern
Print a solid square of*
based on the number of rows and columns entered by the user.
Miscellaneous
- Temperature Conversion
Create a program to convert a given temperature from Celsius to Fahrenheit and vice versa. - Reverse Digits Without Loop
Use recursion to reverse the digits of a number. - Prime Numbers Between Two Integers
Input two integers and find all prime numbers in that range. - Collatz Conjecture
Implement the Collatz Conjecture:
Start with any positive integern
. Ifn
is even, divide it by 2. If odd, multiply it by 3 and add 1. Repeat untiln
becomes 1. Print all the steps. - Multiples Finder
Input two numbers and print all common multiples between 1 and 100.
Let me know if this list fits your needs better! 😊