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: Reply
10/5 =2cost should be right ans
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: