#include<stdio.h> #include<stdlib.h> #include<math.h>

int main() { int i,n,sum; sum=0; printf("enter the number"); scanf("%d",&n); for(i=1;i<=n;i++) { sum=sum+pow(i,2); } printf("%d",sum); system("PAUSE"); }

Advertisements

#include<stdio.h> #include<stdlib.h> #include<math.h>

int main() { int i,n,sum; sum=0; printf("enter the number"); scanf("%d",&n); for(i=1;i<=n;i++) { sum=sum+pow(i,2); } printf("%d",sum); system("PAUSE"); }

Advertisements

Filed under TUTORIALS

%d bloggers like this: