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