Please help me. | Sololearn: Learn to code for FREE!

+1

Please help me.

public class SquareofNumber { public static void main(String[] args) { Scanner sc = new scanner(System.in); System.out.println ("Enter any integer"); int num= scanner.nextIn(); int num= x; if (x==10) { System.out.println ( x + "The square of number is"); if (x==20) { System.out.println ( x + " The square of a number is "); if (x< 10 || x> 20 ) { System.out.println ( x + "Display the word one ten times"); } }

6/14/2021 6:45:19 AM

Cheska

10 Answers

New Answer

+3

import java.util.Scanner; public class SquareofNumber { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println ("Enter any integer"); int num= sc.nextInt(); if (num==10) { System.out.println ( num + "The square of number is"); } if (num==20) { System.out.println ( num + " The square of a number is "); } if (num< 10 || num> 20 ) { System.out.println ( num + " Display the word one ten times"); } } } I corrected your code that you wrote in the description

+1

Write a java program that reads integers and if it belongs to [10,20] displays five times the square of the number , and if the integers outside the given set it should display the word "ONE" ten times

+1

THANKYOUUUU IT WORKS

+1

Aaawww😍 thankyouuuu

0

to start in your code you need to import Scanner: import java.util.Scanner. "If", "else if", "else" must be closed with curly braces

0

Here's the problem Write a java program that reads integers and if it belongs to [10,20] displays five times the square of the number , and if the integers outside the given set it should display the word "ONE" ten times

0

It should display five times the square of the number but it's not working what should I do

0

Thank you I hope it will work

0

Cheska if you have any questions, I'm always happy to help you!

0