Friday, 19 November 2010

program to find out 1.1+2.2+3.3+...n

#include<stdio.h>
#include<conio.h>
void main()
{
 float sum=0;
int n;
printf("enter how many terms to be added\n");
scanf("%d",&n);
for(i=0;i<=n;i++)
{
 sum=sum+1.1*i;
}
printf("%d",sum);
getch();
}

flow chart of find out 1.1+2.2+3.3+...n
c programs

No comments:

Post a Comment