Level: Easy
In this program, you are given an input N, which is a positive integer less than or equal to 40. Write a program to find the sums of fourth powers of the first N numbers.
Sample Input2
Sample Output
17
program---
#include<stdio.h>
#include<math.h>
int main()
{long int sum=0;int i,n;
scanf("%d",&n);
for(i=1;i<=n;i++)
{
sum=sum+pow(i,4);
}
printf("%ld",sum);
return 0;
}
In this program, you are given an input N, which is a positive integer less than or equal to 40. Write a program to find the sums of fourth powers of the first N numbers.
Sample Input2
Sample Output
17
program---
#include<stdio.h>
#include<math.h>
int main()
{long int sum=0;int i,n;
scanf("%d",&n);
for(i=1;i<=n;i++)
{
sum=sum+pow(i,4);
}
printf("%ld",sum);
return 0;
}
No comments:
Post a Comment