Posted by : Unknown Sunday, 28 June 2015

Syntax:

if(condition)
statement;

Program:

import java.util.Scanner;
class result
{
    public static void main(String[] args)
    {
           int mark;
           Scanner s=new Scanner(System.in);
           System.out.print("Enter your mark: ");                   
           mark=s.nextInt();
           if ( mark >= 40 )
           {
           System.out.println("Pass");
           }
    }
}

Output:

Enter your mark: 44 
Pass

Leave a Reply

Subscribe to Posts | Subscribe to Comments

Welcome to My Blog

Translate

Popular Post

Total Pageviews

Blog Archive

- Copyright © Learning Java Program - Powered by Blogger -