Computer Science, asked by ruchi396, 1 year ago

write a Java Program that will accept the score of a batsman and display whether the batsman has scored a century or not

Answers

Answered by Tarun304
16
public class Century
{
public void main (int score)
{
if(score>=100)
System. out.println( "Batsman has scored century");
else
System. out.println("Batsman has not scored century");
}
}

ruchi396: thank you very much
Answered by Incredible29
15
Heya user
Here is your answer !!

_____________


import java.util.* ;
public class Century
{
public static void main ( String args [] )
{
Scanner in = new Scanner ( System.in ) ;
System.out.print ( " Enter the run scored " ) ;
int r = in.nextInt() ;
if ( r >= 100 )
System.out.println ( " The batsman has scored a century " ) ;
else
System.out.println ( " The batsman has not scored a century " ) ;
}
}


_____________

Hope it helps !!

Incredible29: plz follow if u lyk my answer
ruchi396: thank you
Incredible29: u r welcm
Similar questions