Computer Science, asked by VaniSna, 10 months ago

Write a program to input a fractional number in float and another fractional number of double type. Multiply the float type number by 12 and double type by 7.5 .Print the numbers and their multiplied value.​

Answers

Answered by Vyomsingh
2

Answer:

import java.util.*;

class ddd

{

void main()

{

Scanner sc=new Scanner (System.in);

S.o.p("Enter float value");

float a=sc.nextFloat();

S.o.p("Enter double value");

double b=sc.nextDouble();

float k=a*12;

double m=b*7.5;

S.o.p(k);

S.o.p(m);

}

}

Answered by anindyaadhikari13
24

Here is your answer.

import java.util.*;

class x

{

static void main()

{

Scanner sc = new Scanner(System.in);

System.out.print("Enter a float number: ");

float f=sc.nextFloat();

System.out.println(" Enter a double number: ");

double d=sc.nextDouble();

float a=f*12;

double b=d*7.5;

System.out.println(a+"\n"+b);

}

}

Similar questions