Input
Enter 1st number : 8
Enter 2nd number : 5
Output
Sum of two number = 13
Step 1: START
Step 2: Take first number as input.
Step 3: Take second number as input.
Step 4: Print sum
Step 5: END
/* Sum of two number */
#include <stdio.h>
int main()
{
int num1,num2,sum;
printf("Enter the first number : ");
scanf("%d",&num1);
printf("Enter the second number : ");
scanf("%d",&num2);
sum=num1+num2;
printf("sum of two number = %d",sum);
return 0;
}
/* Sum of two number */
#include <iostream>
using namespace std;
int main()
{
int num1,num2,sum;
cout<<"Enter the first number : ";
cin>>num1;
cout<<"Enter the second number : ";
cin>>num2;
sum=num1+num2;
cout<<"sum of two number = "<<sum;
return 0;
}
Enter first number : 8
Enter second number : 5
Sum of Two number = 13
advertisment