C Language – Coding Problems

Website can be closed on 12th to 14th Jan 2025 due to server maintainance work.

You can Practice C – Language by solving these problems.


  1. Odd or Even with Zero Check
    Write a program to check if a number is odd, even, or zero using if-else.
  2. Traffic Light Simulator
    Simulate traffic lights using a switch-case. Take user input (R for red, G for green, Y for yellow) and display appropriate actions.
  3. 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+).
  4. Simple Calculator
    Create a calculator program using a switch-case that performs addition, subtraction, multiplication, and division based on user choice.

  1. Sum of Multiples
    Find the sum of all multiples of 3 or 5 below a number entered by the user using a for loop.
  2. Number Palindrome Checker
    Input a number and check if it is a palindrome (reads the same forward and backward) using a while loop.
  3. Pattern Printing
    Print the following pattern for n rows: 1 12 123 1234
  4. Factorial Without Recursion
    Calculate the factorial of a number using a while loop instead of recursion.

  1. Power Function
    Write a function to compute the power of a number (base^exponent) using a loop.
  2. Palindrome String
    Input a string (without using arrays, take character-by-character input) and check if it is a palindrome using a recursive function.
  3. Number of Digits
    Write a recursive function to count the number of digits in an integer.
  4. HCF (Highest Common Factor)
    Implement a function to calculate the HCF of two integers using loops.

  1. 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.
  2. Print ASCII Values
    Write a program to print all ASCII values for characters from ‘A’ to ‘Z’ using a for loop.
  3. Nested Loops – Square Pattern
    Print a solid square of * based on the number of rows and columns entered by the user.

  1. Temperature Conversion
    Create a program to convert a given temperature from Celsius to Fahrenheit and vice versa.
  2. Reverse Digits Without Loop
    Use recursion to reverse the digits of a number.
  3. Prime Numbers Between Two Integers
    Input two integers and find all prime numbers in that range.
  4. Collatz Conjecture
    Implement the Collatz Conjecture:
    Start with any positive integer n. If n is even, divide it by 2. If odd, multiply it by 3 and add 1. Repeat until n becomes 1. Print all the steps.
  5. Multiples Finder
    Input two numbers and print all common multiples between 1 and 100.

Let me know if this list fits your needs better! 😊

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top