Sums of Powers of Numbers



give input N, which is a positive integer less than or equal to 40.
find the sums of fourth powers of the first N numbers

Program:

#include<stdio.h>
int main()
{
 int N,i;
 long int sum;
 printf("give the input N");
 scanf("%d",&N);
 sum=0;
 for(i=1;i<=N;i++)
  sum=(sum+(i*i*i*i));
 printf("sum=%ld",sum);
}


Sample inputs and outputs:
give the input N
22
sum=1151403