Tuesday, July 10, 2012

1 + 3 + 5 +.....+n =?

Assalamu Alaikum. Hope you all are well by the grace of Almighty ALLAH. Today we learn how to write an odd series in C programming. Take a look at the problem.

Problem: Evaluate the series up to n.
               1 + 3 + 5 + 7 +.......

Sample Input:   9
Sample Output:  25



Solution:


Thank you all..:)

2 comments: