Answers for "Sum of two numbers"

2

how to use addition in c

#include <stdio.h>
int main() {    

    int number1, number2, sum;
    
    printf("Enter two integers: ");
    scanf("%d %d", &number1, &number2);

    // calculating sum
    sum = number1 + number2;      
    
    printf("%d + %d = %d", number1, number2, sum);
    return 0;
}
Posted by: Guest on November-09-2020
4

addition of two numbers in c

int num1,num2;
printf("%d",num1+num2);
Posted by: Guest on July-30-2020
0

Sum of two numbers

<html>
<head>
    <script type="text/javascript">
        function sum() {
            var num1 = Number(document.getElementById("field").value);
            var num2 = Number(document.getElementById("field2").value);
            var sum= num1+num2;
            alert("The sum is" +" "+ sum);
        };
    </script>
</head>
 
<body>
    <h2>Adding two Number</h2>
    <form>
 
        <input type="text" placeholder="Enter A Number" id="field"><br><br>
        <input type="text" placeholder="Enter A Number" id="field2"><br><br>
        <input type="button" value="ADD" onclick="sum()" />
    </form>
</body>
</html>
Posted by: Guest on September-11-2021
0

add 2 numbers in c

#include<stdio.h>
int main() {
int a, b, sum;
printf("\nEnter two no: ");
scanf("%d %d", &a, &b);
sum = a + b;
printf("Sum : %d", sum);
return(0);
Posted by: Guest on December-22-2020

Code answers related to "Sum of two numbers"

Code answers related to "Javascript"

Browse Popular Code Answers by Language