Friday, March 17, 2023

"find the sum of the series 1^3+2^3+3^3+...+n^3 number" using c .

 //find the sum of the series 1^3+2^3+3^3+...+n^3 number

#include <stdio.h >

int main (){
    int n,i,cube ;
    printf ("enter the value of n :");
    scanf ("%i",&n);
    for (i=1;i<=n;i++){
        cube =cube + i*i*i;
    }
    printf ("the sum of cube of 1st n  number is :%d",cube );
    return 0;
}


No comments:

Post a Comment

print a multiplication table of any integer taking from user

 // print a multiplication table of any integer taking from user  #include "stdio.h" int main () { int n,mul,i; printf ("...