write a program to find sum of 2 numbers without using fuction
Answers
Answered by
2
Answer:
class sum
{
public static void main (String args [])
{
double a=5;
double b=2;
double c=a+b;
System.out.print("SUM="+c);
}
}
Step-by-step explanation:
Hope it helped...
Answered by
2
class sum
{
void main()
{
int a = 10;
int b= 20;
int sum = a+b;
System.out.println("Sum is : "+sum);
}
}
import java.util.*;
class sum
{
void main()
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter two numbers");
int a = sc.nextInt();
int b = """""""""""""";
int sum =0;
sum = a+b;
System.out println("Sum of two numbers is : " +sum);
}
}
Similar questions