Computer Science, asked by singhsang77000, 10 months ago

write a program on bluej to add 12.7 and 20.6 . Also, subtract 20 from 23 . print answer​

Answers

Answered by onlinetanmoydas
2

Hi Friend,

Here is your answer...........

For Addition

public class Sum

{

public static void main (String args[])

{

float a=12.7;

float b=20.6;

int sum;

sum=a+b;

System.out.println("sum ="+sum);

}

}

For Substraction

public class Substraction

{

public static void main (String args[])

{

int a=20;

int b=23;

int sum;

sum=a+b;

System.out.println("sum ="+sum);

}

}

Hope it will be helpful to you............

Please!!! mark my answer as Brainliest............

Answered by piyushnehra2006
7

Answer:

Your answer is in the attachment

Attachments:
Similar questions