Java Program Of While Loops

01. Example: public class whileLoopProgram { public static void main(String[] args) { int iteration = 1; while (iteration <= 6) { System.out.println(iteration); iteration++; } } } Output: 1 2 3 …

Read more

Java Program Of For Loop

01. Example: class forLoopPrograms { public static void main(String[] args) { int counter; for (counter = 1; counter <= 6; counter++) { System.out.println(counter); } } } Output: 1 2 3 …

Read more

Java Program to Compare Two String

01. Example: import java.util.Scanner; class compareStrings { public static void main(String args[]) { String string01, string02; Scanner in = new Scanner(System.in); System.out.println("Enter The First String: "); string01 = in .nextLine(); …

Read more

Java Program to Convert Celsius Into Fahrenheit

01. Example: import java.util.*; class celsiusToFahrenheitConversion { public static void main(String[] args) { float temperature; Scanner in = new Scanner(System.in); System.out.print("Enter Temperature In Celsius: "); temperature = in.nextInt(); temperature = …

Read more