Computer Science, asked by dilippaswan620016716, 3 months ago

write a program to accept two numbers and display their sum. ​

Answers

Answered by akshatgupta099
1

Answer:

A very simple Java program.

Explanation:

public class Sum

{

public static void main(int a, int b)

{

System.out.println(“SUM = ” +(a+b));

}

}

Answered by parthraina2005
1

Answer:

Hope it will help you:

For Python

Program:

# This program adds two numbers

num1 = 1.5

num2 = 6.3

# Add two numbers

sum = num1 + num2

# Display the sum

print('The sum of {0} and {1} is {2}'.

Output:

The sum of 1.5 and 6.3 is 7.8

For C

Program-

#include <stdio.h>

int main()

{

int num1, num2, sum;

printf("Enter first number: ");

scanf("%d", &num1);

printf("Enter second number: ");

scanf("%d", &num2);

sum = num1 + num2;

printf("Sum of the entered numbers: %d", sum);

return 0;

}

Output:

Enter first number: 20

Enter second number: 19

Sum of the entered numbers: 39

Please give me a thank and mark as brainliest answer.

Similar questions