C program to print the series (1/2)+(3/4)+(5/6)+ (7/8) + (9/10)
In this program, I have discussed about the C program to find the sum of the series which I have shown above.
Series programs is very important for your academic exams. Terms in the brackets will be solved first and then "+" terms are solved.
#include<stdio.h>
int main()
{float n,i,j,k=0;
for(i=1,j=2;i,j<=10;i+=2,j+=2)
{k=k+(i/j);
}
printf("%f",k);
}
Just copy and paste the program in your desired compiler (Dev C++ is more preferable) and run it.
Enjoy programming in C.
0 comments:
Post a Comment