An Basic Number Guessing Game

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!!");
}
}
}


`

`
`

原文链接:An Basic Number Guessing Game

© 版权声明
THE END
喜欢就支持一下吧
点赞11 分享
Never give up your dreams. Miracles happen everyday.
别放弃梦想,奇迹每天都在上演
评论 抢沙发

请登录后发表评论

    暂无评论内容