Computer Science, asked by 00sam0011, 23 hours ago

Write the algorithm to enter a number and find its half.

Answers

Answered by samarthkrv
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