//sum of the 1^4+2^4+3^4+...+n^4 using c
#include <stdio.h>
int main (){
int i,n,power4;
printf ("enter the value of n :");
scanf ("%i",&n);
for (i=1;i<=n;i++){
power4=power4 + i*i*i*i;
}
printf ("the sum of 1st power4 upto n is : %i",power4);
return 0;
}
No comments:
Post a Comment