Computer Science, asked by arpita60, 1 year ago

write a program in Java to enter cost price of a product and number of unit and display total price

Answers

Answered by mandaldebankur
0
import java.io.*;
public class Number
{
public static void main()throws IOException
{
BufferedReader buff=new BufferedReader(new InputStreamReader(System.in));
Double cp,s;int a;
System.out.print("Enter the no. of units : ");
a=Integer.parseInt(buff.readLine());
System.out.print("Enter the cost price : ");
s=(cp*a);
System.out.println("The Total Price : "+s);
}
}
Similar questions