print
Advertisment
Advertisment

Volume of Cuboid

Example 2

import java.util.Scanner;
class Raj{

 public static void  main(String[] args) {

   int l,w,h;
   int volume;

   Scanner sc = new Scanner(System.in);

   System.out.print("Enter length,width & height: ");

    l = sc.nextInt();
    w = sc.nextInt();
    h = sc.nextInt();

    volume = l* w * h;

    System.out.print("Volume of cuboid is : "+volume);

      }
    }

Output :

 
   
   Enter length,width & height: 15 20 25
   Volume of cuboid is : 7500
   
Advertisment
Advertisment
arrow_upward