Problem: 2.1
Question 2.1: Write a Java program to print 'Hello' on screen and then print your name …
Question 2.1: Write a Java program to print 'Hello' on screen and then print your name …
Question 2.2: A school has following rules for grading system: a. Below 25 - F b. 25 to 45 - E …
Question 2.3: Create a function that takes two numbers as arguments and returns the GCD of the …
Question2.4:Given an integer, create a function that returns the next prime. If the number is p…
Question 2.5:Write a Java program that takes two numbers as input and display the product of tw…
Question 2.6: Write a Java program to print the sum (addition), multiply, subtract, divide and r…
Question 2.7: Write a Java program that takes a number as input and prints its multiplication …
Question 2.8: Create a function that finds how many prime numbers there are, up to the given in…
Question 2.9 : Write a Java program to compute a specified formula. Specified Formula: 4.0 * (1 …
Question 2.10: Write a Java program to print the area and perimeter of a circle. Test Data: Radi…
Question 2.11: Write a Java program that takes three numbers as input to calculate and print th…
Question 2.12: Write a Java program to print the area and perimeter of a rectangle. Test Data: …
Question 2.13: Write a Java program to swap two variables. Solution: package com.company; impo…
Question 2.14: Write a Java program to compare two numbers. Input Data: Input first integer: 25…
Question 2.15: Write a Java program and compute the sum of the digits of an integer. Input Data…
Question 2.16: Write a Java program to print the odd numbers from 1 to 99. Prints one number pe…
Question 2.17: Create a function that takes an integer n and reverses it. Examples rev(5121) ➞ &…
Question 2.18: Write a Java program to calculate the sum of two integers and return true if the…
Question 2.19 : Write a Java program that accepts three integer values and return true if one of…
Question 2.20: Write a Java program that accepts two integer values between 25 to 75 and return …