Example Programs using Control statements in Java
✅ 1. Check if a Number is Even or Odd
Problem: Read a number and check whether it is even or odd.
✅ 2. Find the Largest of Three Numbers
Problem: Take three numbers as input and find the largest among them.
✅ 3. Print Multiplication Table of a Number
Problem: Read a number and print its multiplication table up to 10.
✅ 4. Sum of Digits of a Number
Problem: Read an integer and find the sum of its digits.
✅ 5. Check Whether a Number is Prime
Problem: Read a number and check if it is a prime number.
Comments
Post a Comment