1 to n number addition

assalamu Alaikum. Hope, you all are well by the grace of Almighty ALLAH. Today we learn how to add numbers between 1 to n number. Take a look at the program.

Using while:



We can also write this program by decrements. Take a look at the program.




Using do while:



We can also write this program by decrements. Take a look at the program.



Using for:



We can also write this program by decrements. take a look at the program.


We can also do this program by the following way..



Thank you all..:)


0 comments:

Post a Comment