Computer Science, asked by singhmanikant427, 6 months ago

suggest some programs of scanner class without if or if else​

Answers

Answered by jeromeseejo73
1

//program to find the square of a number given by the user

import java. util. Scanner;

public class somename

{

public static void main(String[] args)

{

Scanner sc=new Scanner(System.in) ;

System.out.print("Enter a number: ")

double num=school.nextDouble() ;

double square_num=Math.pow(num) ;

System.out.print("The square of "+num+" is "+square_num)

}

}

Answered by Khushi7153
2

Answer:

hi dear friend

how are you I hope you are fine

Similar questions