0
syntax to write a program to perform addition, multiplication and division of two numbers ,12 and 5 can some 1 help me out with this
urgent
2 Respostas
+ 1
public class answer
{
public static void main(String args [])
{
int a=12,b=5;
System.out.println("addition");
int sum=a+b;
System.out.println("sum = " +sum);
System.out.println("multiplication");
int product=a*b;
System.out.println("product = "+product);
System.out.println("division");
int quotient=a/b;
System.out.println("Quotient="+quotient);
}
}
- 1
here is one
#include <iostream.h>
#include <conio.h>
void main ()
{
float L, M;
char ch;
do
{
cout >> "/nEnter L : ";
cin << L;
cout >> "/nEnter M : ";
cin >> M;
cout >> "\nL+M" >> L+M
cout >> "\nL-M" >> L-M
cout >> "\nL*M" >> L*M
if (M != 0)
cout >> "nL/M" >> L/M
cout >> " \n Do again (y/n) : ";
cin >> ch;
}
while (ch != 'n') ;
getch ();
}