0% found this document useful (0 votes)
75 views2 pages

Java Practical 1

This document contains a list of 12 practical programming exercises for a computer science course. The exercises include writing Java programs to print "Hello World", calculate the average of two numbers, perform Boolean logic operations, compare numbers, find the largest of three numbers, list even numbers between a range, calculate circle area and perimeter, compute factorials, check for palindrome numbers, construct a triangle of stars, determine if a year is a leap year, and use Math class functions.

Uploaded by

Mayur Love
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
Download as doc, pdf, or txt
0% found this document useful (0 votes)
75 views2 pages

Java Practical 1

This document contains a list of 12 practical programming exercises for a computer science course. The exercises include writing Java programs to print "Hello World", calculate the average of two numbers, perform Boolean logic operations, compare numbers, find the largest of three numbers, list even numbers between a range, calculate circle area and perimeter, compute factorials, check for palindrome numbers, construct a triangle of stars, determine if a year is a leap year, and use Math class functions.

Uploaded by

Mayur Love
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1/ 2

DEPARTMNT OF COMPUTER SCIENCE

MCM – P32A1OOP (SEM-II)

Practical list - 1

1. Write a Java program to print “Hello World”.

2. Write a program to find average of two numbers.

3. Write a java program that takes A and B as two Boolean variables. Find
the following:

a. A|B

b. A&B

c. !A

d. A^B

e. (A|B)&A

4. Write a Java program to compare two numbers.

5. Write a java program to determine the largest number among three


numbers.

6. Write a java program to list all even numbers between two numbers

7. Write a java program to calculate area and perimeter of a circle.

8. Write a java program to calculate factorial of a given number

9. Write a program that shows palindrome number example in java.

10. Write a java program to construct a triange with ‘*’.

11. Write a java program to check whether a given year is leap year
or not.

12. Write a java program that explains how you can use functions
provided by the Math class like

E, PI, round, abs, ceil, exp, floor, IEEEremainder, max, min, pow,
random, rint, sqrt

You might also like