Algorithm
- Take Three Variable,
number1
,number2
andsummation
. - Assign values on
number1
andnumber2
. - Make
summation = number1 + number2
. - Print Summation.
Code Examples
#1 Basic Simple Summation
Code -
C Programming
#include <stdio.h>
int main(){
int summation = 0;
int number1 = 10;
int number2 = 20;
summation = number1 + number2;
printf("Summation %d", summation);
return 0;
}
Copy The Code &
Try With Live Editor
Output
Summation 30
#2 Summation Coding Example with Input
Code -
C Programming
#include <stdio.h>
int main(){
int summation = 0;
int number1, number2 = 0;
printf("Enter Number 1: ");
scanf("%d", &number1);
printf("Enter Number 2: ");
scanf("%d", &number2);
summation = number1 + number2;
printf("Summation = %d\n", summation);
return 0;
}
Copy The Code &
Try With Live Editor
Input
Enter Number 1: 30
Enter Number 2: 100
Enter Number 2: 100
Output
Summation = 130
Demonstration
This is the Basic Programming of arithmatic. It calculates the sum of two numbers.