1.
Data Types & Variables
🔹 Beginner Exercises:
● Q1: Declare variables of all primitive data types and print their default values.
● Q2: Write a program to swap two integers using a temporary variable.
● Q3: Write a program to calculate the area and perimeter of a rectangle.
2. Operators
🔹 Arithmetic, Relational, Logical, and Bitwise:
● Q4: Take two numbers and perform all arithmetic operations.
● Q5: Check if a number is even or odd using the modulus operator.
● Q6: Use relational and logical operators to validate a user's age (e.g., age must be 18–60).
● Q7: Write a program to show the effect of bitwise AND, OR, and XOR on two integers.
3. Control Statements
🔹 If-Else & Switch:
● Q8: Write a program to check whether a number is positive, negative, or zero.
● Q9: Take input marks and print grade using if-else:
○ 90+ = A, 80–89 = B, 70–79 = C, else = F.
● Q10: Create a calculator using switch-case (operations: +, −, *, /, %).
● Q11: Find the largest of three numbers using nested if-else.
🔹 Loops (for, while, do-while):
● Q12: Print all even numbers from 1 to 100.
● Q13: Print the multiplication table of a given number.
● Q14: Calculate factorial of a number.
● Q15: Check if a number is a palindrome.
● Q16: Print Fibonacci series up to n terms.
● Q17: Count digits in a number.
● Q18: Reverse a number.