Algorithm for addition 2 numbers (Version 1, Version 2, Version 3)

Following is algorithm for addition of 2 integers using single scanf().
  
Step 1: Start
 
Step 2: Declare variables a,b & c. 
 
Step 3: Read values a & b. 
 
Step 4: Add a and b and assign the result to c.
        c=a+b 
 
Step 5: Display c 
 
Step 6: Stop
 
 
Following is algorithm for addition of 2 integers using multiple scanf().

1) Start.
2) Accept first number.
3) Accept second number.
4) Add both numbers.
5) Print the result.
6) End


Following is algorithm for addition of 2 integers.
  1. Start
  2. Read the Value of A and B.
  3. SUM = A+B.
  4. Display SUM.
  5. Stop

 

Comments