Write the algorithm to enter a number and find its half.
Answers
Answered by
0
Answer:
import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("Enter a number:");
int n = sc.nextInt();
System.out.println("Half of " + n + " is " + (n/2d));
}
}
Explanation:
Similar questions
Math,
12 hours ago
Math,
12 hours ago
Biology,
12 hours ago
Geography,
23 hours ago
CBSE BOARD XII,
23 hours ago
Computer Science,
8 months ago
English,
8 months ago