Posts

Showing posts from July, 2022

Celsius to Fahrenheit

Image

Star pattern

Image
 

Input /output in java

Image
 Input/Output in Java In this challenge, you will learn to read input for the first time. Most popular way to read input in java is by using Scanner. For example: Scanner scanner = new Scanner(System.in); int myInt scanner.nextInt(); System.out.println("myInt is: "myInt); The code above creates a Scanner object named scanner and uses it to read an integer. It prints output using System.out.println(MyInt).  So, if our input is: 5 Our code will print: myInt is: 5 User Task In this challenge, you must read 3 integers and then print them. Each integer must be printed on a new line. Input Format There are 3 lines of input, and each line contains a single integer Sample Input 42 100 125 Sample Output 42 100 125

Five star

Image
 There is no input for the program. You just need to print the stars in the format shown. Print 5 horizontal stars separated by 1 space followed by 5 vertical stars.

Welcome to java

Image
In this challenge, you will learn how to print "Hello World!" in standard output (stdout). Complete the code by copying the two lines of code below and pasting them inside the body of your main method. System.out.println("Hello, World."); System.out.println("Hello, Java.");