Tuesday, March 5, 2024

10. 0 7 26 ... 999

10. 0 7 26 ... 999

=(1³-1) (2³-1) (3³-1) ... (10³-1) :—


#include<stdio.h>

int main()

{

    int i,sum;

    sum=0;

    for(i=1;i<=10;i++)

    {

        sum=sum+i*i*i-1;

    }

    printf("%d",sum);

    return 0;

}


No comments:

Post a Comment