Exp 5 PPS Lab
Exp 5 PPS Lab
AIM:
To design an algorithm and flowchart for the addition the two numbers using C
language.
ALGORITHM:
Step 1: Start
Step 2: Declare variables N1, N2 and Sum.
Step 3: Read values for N1, N2.
Step 4: Add N1 and N2 and assign the result to a variable Sum.
Step 5: Display Sum
Step 6: Stop
FLOWCHART:
PROGRAM:
#include <stdio.h>
int main()
{
int N1, N2, Sum;
printf("\n Enter the First Number: ");
scanf("%d",&N1);
printf("\n Enter the Second Number: ");
scanf("%d",&N2);
Sum = N1 + N2;
printf("Sum of Numbers %d + %d = %d", N1,N2, Sum);
return 0;
}
OUTPUT:
Enter the First Number: 20
Enter the Second Number: 20
Sum of Numbers 20 + 20 = 30
RESULT:
Thus the designing an algorithm and flowchart for the addition the two numbers using
C language has been executed and verified successfully.