Friday, 13 December 2019

write a java program to find the largest of two value using Math Function max()

Program :

import java.lang.Math ;
public class Maximum
{
    public static void main(String[] args) {  
 
        int n1 , n2 ;

        n1 = 3 ;
        n2 = 4 ;

        System.out.println("Maximum of " + n1 +" and " + n2 + " is " + Math.max(n1 , n2)) ;

    }
}

Output :


No comments:

Post a Comment

Write a java program to input marks of 5 student if 5 subject out of 100 marks each , output sum and percentage of marks and appropriate division i.e distigusion first class upto fail

Programe : import java.util.*; class Student { public static void main(String args[])     {     Scanner s = ...