Write a program in c find the sum of s = 1*3 + 3*5 + 5*7 + 7*9 + ............. + 21*23
#include< #include< #include< main() { int i, s; s = 0; for (i=1; i < = 21; i=i+2) { s = s + i * (i+2); } printf("\n The sum is %d \n", s); return(0); } |
---|
#include< #include< #include< main() { int i, s; s = 0; for (i=1; i < = 21; i=i+2) { s = s + i * (i+2); } printf("\n The sum is %d \n", s); return(0); } |
---|
© Blogger templates Newspaper III by Ourblogtemplates.com 2008
Back to TOP
0 comments:
Post a Comment