DEV Community

Aafthab Ali Shaik
Aafthab Ali Shaik

Posted on

An Basic Number Guessing Game

Image description

In Written format down below!!

`


import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter the Guess Number :");
System.out.println("Enter a number between 1 to 100 :");
int a = sc.nextInt();
int sr = 70;
while(a!=sr){
if(a>80){
System.out.println("Too big bro:");
}else if(a<60){
System.out.println("Too small bro:");
}else if(a<=75 && a>=65){
System.out.println("You'r almost there!");
}
System.out.println("Try Again:");
a = sc.nextInt();
System.out.println("\nBravo!! You got it!!");
}
}
}


`

`
`

Top comments (0)