#include<stdio.h> int main() { int a,n,sum=0; printf("enter the value of n :"); scanf("%d",&n); for(a=1;a<=n;a++) { sum=sum+(a*a); } printf("sum=%d",sum); return 0; }
No comments:
Post a Comment