123k views
5 votes
Write an algorithm and flowchart to calculate sum of two given numbers​

User Surya
by
5.2k points

1 Answer

2 votes
Step 1: Start
Step 2: Declare variables num1, num2 and sum.
Step 3: Read values for num1, num2.
Step 4: Add num1 and num2 and assign the result to a variable sum.
Step 5: Display sum
Step 6: Stop
#include
int main()
{
int num1,num2,sum;
printf("\\ Enter the first number to be added: ");
scanf("%d",&num1);
printf("\\ Enter the second number to be added: ");
scanf("%d",&num2);
sum = num1 + num2;
printf("\\ The sum of two numbers is: %d",sum);
return 0;
}
User DJayC
by
5.3k points