Write a program in c to find the sum s = 1/2 + 3/4 + 5/6 + 7/8 + 9/10 + 11/12
#include< #include< #include< main() { int i, s; s = 0; for (i=1; i < = 11; i=i+2) { s = s + i / (i+1); } printf("\n The sum is %d \n", s); return(0); } |
---|
#include< #include< #include< main() { int i, s; s = 0; for (i=1; i < = 11; i=i+2) { s = s + i / (i+1); } 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