Javaprograms
Javaprograms
3. Take a number as input and print the multiplication table for it.
5. Keep taking numbers as inputs till the user enters ‘x’, after that print sum of all.
2. Take name as input and print a greeting message for that particular name.
3. Write a program to input principal, time, and rate (P, T, R) from the user and
4. Take in two numbers and an operator (+, -, *, /) and calculate the value.
(Use if conditions)
2. Area Of Triangle
5. Area Of Parallelogram
6. Area Of Rhombus
8. Perimeter Of Circle
23. Input a number and print all the factors of that number (use loops).
24. Take integer inputs till the user enters 0 and print the sum of all numbers
25. Take integer inputs till the user enters 0 and print the largest number from
all.
7. Power In Java
25. Kunal is allowed to go out with his friends only on the even days of a given month. Write a
program to count the number of days he can go out in the month of August.
26. Write a program to print the sum of negative numbers, sum of positive even numbers and the
sum of positive odd numbers from a list of numbers (N) entered by the user. The list terminates
when the user enters a zero.
1. [Define two methods to print the maximum and the minimum number respectively among three
numbers entered by the user.](https://www.java67.com/2019/05/how-to-find-largest-and-smallest-
of-three-numbers-in-java.html)
4. [Write a program to print the sum of two numbers entered by user by defining your own
method.](https://code4coding.com/addition-of-two-numbers-in-java-using-method/)
6. [Write a program to print the circumference and area of a circle of radius entered by user by
defining your own method.](https://beginnersbook.com/2014/01/java-program-to-calculate-area-
and-circumference-of-circle/)
8. [Write a program that will ask the user to enter his/her marks (out of 100). Define a method that
will display grades according to the marks entered as
below:](https://www.techcrashcourse.com/2017/02/java-program-to-calculate-grade-of-
students.html) <br/>
<pre>
Marks Grade
91-100 AA
81-90 AB
71-80 BB
61-70 BC
51-60 CD
41-50 DD
<=40 Fail
Factorial of any number n is represented by n! and is equal to 1 * 2 * 3 * .... * (n-1) *n. E.g.-
4! = 1 * 2 * 3 * 4 = 24
3! = 3 * 2 * 1 = 6
2! = 2 * 1 = 2
Also,
1! = 1
0! = 1
</pre>
13. [Write a function that returns all prime numbers between two given
numbers.](https://www.geeksforgeeks.org/program-to-find-prime-numbers-between-given-
interval/)