Skip to content

100 problem practical list

🔹 1. Basics & Getting Started

  1. Write a program to print “Hello, World!”
  2. Print your name and roll number on separate lines.
  3. Print a sentence with escape characters (\n, \t, etc.).
  4. Display the sum of two integers entered by the user. ✅
  5. Display the product of two floating-point numbers. ✅
  6. Input a number and print its square. ✅
  7. Find area of a rectangle using user input. ✅
  8. Input temperature in Celsius and convert to Fahrenheit.
  9. Calculate simple interest given principal, rate, and time.
  10. Display ASCII value of a given character.

🔹 2. Syntax, Input & Output

  1. Take two integers and print their sum, difference, and quotient.
  2. Take three numbers and print their average.
  3. Print a float number rounded to 2 decimal places.
  4. Display a number in hexadecimal and octal form.
  5. Print a formatted table of student name, age, and marks.

🔹 3. Variables

  1. Declare and print variables of different types (int, float, char).
  2. Swap values of two integers using a temporary variable.
  3. Swap values of two integers without using a third variable.
  4. Read length and width, compute area and perimeter of a rectangle.
  5. Convert kilometers to miles.
  6. Convert hours to minutes and seconds.
  7. Find compound interest using pow() from <math.h>.
  8. Input two numbers and swap using pointers.
  9. Calculate volume of a cylinder using πr²h.
  10. Compute BMI (Body Mass Index) given weight and height.

🔹 4. Data Types

  1. Display size of each data type using sizeof().
  2. Demonstrate implicit type conversion.
  3. Demonstrate explicit type casting ((float) division).
  4. Input a character and print next character in ASCII.
  5. Read an integer and print its binary equivalent (manually using division).

🔹 5. Constants

  1. Define a constant for π and find area of a circle.
  2. Use #define to store USD-to-BDT conversion and print conversion result.
  3. Declare const float TAX = 0.05 and compute final price after tax.
  4. Define constants for subject marks and calculate total.
  5. Use const to define gravity and compute weight = mass × g.

🔹 6. Operators

  1. Demonstrate all arithmetic operations on two integers.
  2. Find the remainder without using %.
  3. Compute average of five marks using assignment operators (+=).
  4. Demonstrate pre-increment and post-increment difference.
  5. Compare two numbers using relational operators.
  6. Use logical AND/OR/NOT to verify a condition.
  7. Find maximum of two numbers using ternary operator.
  8. Check if a number is even using bitwise AND (n & 1).
  9. Left-shift and right-shift a number and print results.
  10. Calculate a² + b² + 2ab using only arithmetic operators.

🔹 7. Booleans (using _Bool or stdbool.h)

  1. Input a number and print true if even, false if odd.
  2. Check if a user is adult (age >= 18) and print Boolean result.
  3. Create a Boolean that turns true if temperature > 30.
  4. Store Boolean result of (a == b) in a variable and print it.
  5. Toggle a Boolean variable’s state from true to false.

🔹 8. If / Else

  1. Check if a number is positive, negative, or zero.
  2. Check if a number is even or odd.
  3. Find the largest of two numbers.
  4. Find the largest of three numbers.
  5. Check whether a character is vowel or consonant.
  6. Determine if a year is a leap year.
  7. Check if a number is divisible by 5 and 11.
  8. Print grade based on marks (A, B, C, D, F).
  9. Check whether input character is uppercase, lowercase, digit, or symbol.
  10. Input angles of a triangle and check if it is valid.

🔹 9. Switch

  1. Create a simple calculator using switch case.
  2. Print day of week name for given number (1–7).
  3. Print month name for given number (1–12).
  4. Use switch to check grade category based on mark range.
  5. Display menu for shapes (circle, rectangle, triangle) and calculate area.
  6. Simulate a mini vending machine menu.
  7. Implement a temperature unit converter using switch.
  8. Implement currency converter (USD, BDT, INR).
  9. Print number of days in a month.
  10. Simple login system using switch (username/password choice).

🔹 10. While Loop

  1. Print numbers from 1 to 100.
  2. Print even numbers between 1 and 50.
  3. Print odd numbers between 1 and 50.
  4. Calculate sum of first n natural numbers.
  5. Calculate factorial of a number.
  6. Reverse the digits of a number.
  7. Count number of digits in an integer.
  8. Check if a number is palindrome.
  9. Check if a number is armstrong number.
  10. Display multiplication table for a given number.

🔹 11. For Loop

  1. Print numbers 1 to 10 using a for loop.
  2. Print squares of first 10 natural numbers.
  3. Find sum of even numbers up to n.
  4. Generate Fibonacci series up to n terms.
  5. Find GCD and LCM of two numbers.
  6. Print all prime numbers between 1 and 100.
  7. Check if a number is prime or not.
  8. Find sum of digits of a number.
  9. Find reverse of a number.
  10. Display patterns using nested loops (right triangle, inverted triangle, pyramid).

🔹 12. Break / Continue

  1. Print numbers 1–20 but stop at 13 using break.
  2. Skip printing 10 using continue.
  3. Keep taking input until user enters a negative number.
  4. Read 10 numbers; stop if zero is entered.
  5. Display even numbers from 1–30 but skip multiples of 6.
  6. Search for a number in a list and break when found.
  7. Input numbers continuously; break when sum exceeds 100.
  8. Print all characters of a string until a space is found.
  9. Display 1–10; use continue to skip numbers divisible by 3.
  10. Read numbers from user until they enter 999 (exit condition).