#include<stdio.h> int main(void) { int denominator,n,i; double sum,m; printf("Enter n:"); scanf("%d",&n); sum=0; denominator=1; for(i=m;i<=n;i++){ sum=sum+i*i+1.0/denominator; denominator=denominator+1; } printf("sum=%.2f ",sum); return 0; }
#include<stdio.h> int main(void) { int denominator,n,i; double sum,m; printf("Enter n:"); scanf("%d",&n); sum=0; denominator=1; for(i=m;i<=n;i++){ sum=sum+i*i+1.0/denominator; denominator=denominator+1; } printf("sum=%.2f ",sum); return 0; }