Variables and DataTypes - Samrat
import java.util.*; class Main { public static void main(String[] args) { int $ = 34; // no error System.out.println($); } // int A = scn.nextInt(); // int B = scn.nextInt(); // int C = scn.nextInt(); // double average = (A+B+C)*(1.0)/3.0; // System.out.println("Average of 3 numbers is: " + average); // int side = scn.nextInt(); // int area = side*side; // System.out.println(area); // Scanner scn = new Scanner(System.in); // float pencil = scn.nextFloat(); // 5.0 // float pen = scn.nextFloat(); // 10.0 // float eraser = scn.nextFloat(); // 3.0 // float total_cost = pencil + pen + eraser; // 5.0 + 10.0 + 3.0 = 18.0 // float gst = (total_cost)*0.18f; // 18.0 * (0.18) = 3.2400002 // float total_bill = total_cost + gst; // 21.24 // System.out.println("Total cost is " + total_cost); // System.out.println("Total gst is " + gst); // System.out.println("Total bill amount is " + total_bill); }
Leave a Comment