Q: program to print total of (1/2)+(2/3)+....+(9/10)
#include
#include
void main()
{
float i=1,k,j=2,sum=0;
clrscr();
for(k=1;k<=9;k++)
{
sum=sum+(i/j);
i++;
j++;
}
printf("sum=%f ",sum);
getch();
}
This blog is for the struggling programmers who need assitance..
No comments:
Post a Comment