Thursday 6 April 2017

Algorithm to Print Odd Numbers to a Limit and to Print Their Sum


Step 1 : Start
Step 2 : Read Limit
Step 3 :  i = 1, Sum = 0 ,Count = 1 
Step 4 : if  Count <=  Limit then go to Step 5 
             else go to Step 9
Step 5 : Print i
Step 6 : Sum = Sum + i
Step 7 : i = i + 2
Step 8 : Count = Count + 1 , then  go to Step 4
Step 8 : Print Sum
Step 9 : Stop

No comments:

Post a Comment

How to Invert an SVG image using CSS ?

You can invert your svg easily by using following css code svg { -webkit-filter: invert(100%); /* safari 6.0 - 9.0 */ filter...