100 problem practical list
🔹 1. Basics & Getting Started¶
- Write a program to print “Hello, World!”
- Print your name and roll number on separate lines.
- Print a sentence with escape characters (
\n,\t, etc.). - Display the sum of two integers entered by the user. ✅
- Display the product of two floating-point numbers. ✅
- Input a number and print its square. ✅
- Find area of a rectangle using user input. ✅
- Input temperature in Celsius and convert to Fahrenheit.
- Calculate simple interest given principal, rate, and time.
- Display ASCII value of a given character.
🔹 2. Syntax, Input & Output¶
- Take two integers and print their sum, difference, and quotient.
- Take three numbers and print their average.
- Print a float number rounded to 2 decimal places.
- Display a number in hexadecimal and octal form.
- Print a formatted table of student name, age, and marks.
🔹 3. Variables¶
- Declare and print variables of different types (
int,float,char). - Swap values of two integers using a temporary variable.
- Swap values of two integers without using a third variable.
- Read length and width, compute area and perimeter of a rectangle.
- Convert kilometers to miles.
- Convert hours to minutes and seconds.
- Find compound interest using
pow()from<math.h>. - Input two numbers and swap using pointers.
- Calculate volume of a cylinder using πr²h.
- Compute BMI (Body Mass Index) given weight and height.
🔹 4. Data Types¶
- Display size of each data type using
sizeof(). - Demonstrate implicit type conversion.
- Demonstrate explicit type casting (
(float)division). - Input a character and print next character in ASCII.
- Read an integer and print its binary equivalent (manually using division).
🔹 5. Constants¶
- Define a constant for π and find area of a circle.
- Use
#defineto store USD-to-BDT conversion and print conversion result. - Declare
const float TAX = 0.05and compute final price after tax. - Define constants for subject marks and calculate total.
- Use
constto define gravity and compute weight = mass × g.
🔹 6. Operators¶
- Demonstrate all arithmetic operations on two integers.
- Find the remainder without using
%. - Compute average of five marks using assignment operators (
+=). - Demonstrate pre-increment and post-increment difference.
- Compare two numbers using relational operators.
- Use logical AND/OR/NOT to verify a condition.
- Find maximum of two numbers using ternary operator.
- Check if a number is even using bitwise AND (
n & 1). - Left-shift and right-shift a number and print results.
- Calculate
a² + b² + 2abusing only arithmetic operators.
🔹 7. Booleans (using _Bool or stdbool.h)¶
- Input a number and print
trueif even,falseif odd. - Check if a user is adult (
age >= 18) and print Boolean result. - Create a Boolean that turns
trueif temperature > 30. - Store Boolean result of
(a == b)in a variable and print it. - Toggle a Boolean variable’s state from
truetofalse.
🔹 8. If / Else¶
- Check if a number is positive, negative, or zero.
- Check if a number is even or odd.
- Find the largest of two numbers.
- Find the largest of three numbers.
- Check whether a character is vowel or consonant.
- Determine if a year is a leap year.
- Check if a number is divisible by 5 and 11.
- Print grade based on marks (A, B, C, D, F).
- Check whether input character is uppercase, lowercase, digit, or symbol.
- Input angles of a triangle and check if it is valid.
🔹 9. Switch¶
- Create a simple calculator using switch case.
- Print day of week name for given number (1–7).
- Print month name for given number (1–12).
- Use switch to check grade category based on mark range.
- Display menu for shapes (circle, rectangle, triangle) and calculate area.
- Simulate a mini vending machine menu.
- Implement a temperature unit converter using switch.
- Implement currency converter (USD, BDT, INR).
- Print number of days in a month.
- Simple login system using switch (username/password choice).
🔹 10. While Loop¶
- Print numbers from 1 to 100.
- Print even numbers between 1 and 50.
- Print odd numbers between 1 and 50.
- Calculate sum of first n natural numbers.
- Calculate factorial of a number.
- Reverse the digits of a number.
- Count number of digits in an integer.
- Check if a number is palindrome.
- Check if a number is armstrong number.
- Display multiplication table for a given number.
🔹 11. For Loop¶
- Print numbers 1 to 10 using a
forloop. - Print squares of first 10 natural numbers.
- Find sum of even numbers up to n.
- Generate Fibonacci series up to n terms.
- Find GCD and LCM of two numbers.
- Print all prime numbers between 1 and 100.
- Check if a number is prime or not.
- Find sum of digits of a number.
- Find reverse of a number.
- Display patterns using nested loops (right triangle, inverted triangle, pyramid).
🔹 12. Break / Continue¶
- Print numbers 1–20 but stop at 13 using
break. - Skip printing 10 using
continue. - Keep taking input until user enters a negative number.
- Read 10 numbers; stop if zero is entered.
- Display even numbers from 1–30 but skip multiples of 6.
- Search for a number in a list and break when found.
- Input numbers continuously; break when sum exceeds 100.
- Print all characters of a string until a space is found.
- Display 1–10; use
continueto skip numbers divisible by 3. - Read numbers from user until they enter 999 (exit condition).