0% found this document useful (0 votes)
26 views4 pages

Pro List Oop

Uploaded by

Mr Venki
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views4 pages

Pro List Oop

Uploaded by

Mr Venki
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

HTGwalani

Simple Java Program


1. WAP to print hello world.
2. WAP to find sum of two numbers.
3. WAP to calculate area of circle.
4. WAP to calculate perimeter of rectangle.
5. WAP to convert temperature from degree & Fahrenheit to Celsius.
6. WAP to enter marks of five subjects and calculate total marks, average
and percentage.
7. WAP to calculate simple interest.
8. WAP to calculate compound interest.
9. WAP to convert centimetre into meter and kilometre.
10.WAP to enter two numbers and perform all arithmetic operations.
11.WAP to swap two number without using third variable.
12.WAP to swap two number with using third variable.

if else Program
1. WAP to check no. is positive or negative.
2. WAP to check age is greater than 18 or not.
3. WAP to check number is even or odd
4. WAP to check no. is positive or negative or zero
5. WAP to check greatest of three numbers
6. WAP to check lowest of three numbers
7. WAP to check year is leap or not
8. WAP for grading system
• if percentage > 75 distinction
• percent between 60 & 75 1st
• percent between 45 to 60 2nd
• percent between 35 to 45 3rd
• percent less than 35 fail
9. WAP to check person eligible for donating blood.
if age > 18 and weight > 50 eligible else not
10.WAP to check maximum between two numbers.
HTGwalani

11.Write a Java Program to Check Whether the Character is Vowel or


Consonant using IF-ELSE.

Loops
1 Write a program to find the sum of the first N natural numbers.
2. Write a program to calculate the factorial of a given number.
3. Write a program to reverse a given integer.
4. Write a program to calculate the sum of digits of a given number.
5. Write a program to check if a number is prime or not.
6. Write a program to print the first N terms of the Fibonacci series.
7. Write a program to find the greatest common divisor (GCD) of two numbers.
8. Write a program to find the sum of all even numbers up to N.
9. Write a program to count the number of digits in a given number.
10. Write a program to check whether a given number is a palindrome.
11. Write a program to print Multiplication Table.
12.Explain various loops used in JAVA and also write a program to calculate the
following sum: 5+10+15+20+…..+100
13. Write a java program to print the square of first 10 even numbers.
Nested Loops:
1. Print a Right-Angled Triangle
Write a program to print a right-angled triangle pattern using nested loops:
*
**
***
****

2. Multiplication Table Grid


Write a program to print a multiplication table grid for numbers from 1 to 5
using nested loops.

3. Number Square Pattern


Write a program to print a square pattern of numbers using nested loops:
HTGwalani

123
123
123

4. Inverted Right-Angled Triangle


Write a program to print an inverted right-angled triangle pattern using nested
loops:
****
***
**
*

5. Rectangle Pattern of Stars


Write a program to print a rectangle pattern of stars (*) using nested loops:
*****
*****
*****

6. Hollow Square Pattern


Write a program to print a hollow square pattern using nested loops:
*****
* *
*****

7. Floyd’s Triangle
Write a program to print Floyd's triangle using nested loops:
1
23
456
7 8 9 10

8. Pyramid Pattern of Stars


Write a program to print a pyramid pattern using nested loops:
*
***
*****
HTGwalani

9. Diamond Pattern of Stars


Write a program to print a diamond pattern using nested loops:
*
***
*****
***
*

10. Checkerboard Pattern


Write a program to print a checkerboard pattern of stars and spaces using nested
loops:
****
***
****
***

You might also like