Write a program to read cost of 10 pens and find the cost of 5 pens
Answers
Answered by
0
10/5 =2cost should be right ans
Answered by
2
Answer:
import java.util.*;
class cost
{
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
System.out.println("enter the cost of 10 pens");
double cost = sc.nextInt();
double cost_5 = cost/2;
System.out.println("Cost of 5 pens= "+cost_5);
}
}
Step-by-step explanation:
Similar questions