0% found this document useful (0 votes)
15 views1 page

Exercise - 1 Subject: Java Programming

The document provides 12 Java programming exercises including printing text, getting user input, performing calculations, using conditional statements and loops. The exercises cover basic and intermediate Java concepts like data types, control flow, methods and functions.

Uploaded by

KM
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)
15 views1 page

Exercise - 1 Subject: Java Programming

The document provides 12 Java programming exercises including printing text, getting user input, performing calculations, using conditional statements and loops. The exercises cover basic and intermediate Java concepts like data types, control flow, methods and functions.

Uploaded by

KM
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/ 1

Christ Polytechnic Institute Programming in Java (3350703)

Exercise – 1

Subject: JAVA PROGRAMMING

1. Write a program in Java to print “Hello World” on the screen.


2. Write a program in Java to get different values (Integer, Float, and String) forms the
user and print it on a screen.
3. Write a program to get three subject marks from the user and calculate total and
average of marks and print all three subject marks, total and average on the screen.
4. Write a program to find out maximum number out of three numbers using
conditional operator.
5. Write a program to get salary of employee from the user and calculate bonus
according to the entered salary. If salary >= 10000 then give 10% discount on salary.
If salary < 10000 then discount is 5% of salary. If salary <= 0 then print “Enter valid
amount” on the screen.
6. Write a program to find odd numbers between 1 to 100 numbers by using while loop
in Java.
7. Write a program to find even numbers between 1 to 100 numbers by using do..while
loop in Java.
8. Write a program to generate Fibonacci series up to n number by using for loop.
9. Write a program in Java to generate first n prime numbers.
10. Write a program in Java to find second maximum of n numbers without using arrays.
11. Write a program in Java to reverse the digit of number using while loop.
12. Write a program in Java to convert number into words and print it on a screen.

Prepared by | Hemang R Chath

You might also like