Friday, 13 December 2019

write a java program to demonstrate used of Math Function pow()

Program :

import java.lang.Math ;
public class Power
{
    public static void main(String[] args) {
        double n1 = 2 , n2 = 3;

        System.out.println(+n1 + " ^ " + n2 + " = " +Math.pow(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 = ...