(1+2+3.....n) Sum of n natural numbers, (1^2 + 2^2+3^2 ...... n^2)Sum square of n natural numbers, Sum cube of n natural numbers program in C language .
Natural numbers program in c language H ow to make (1+2+3.....n) Sum of n natural numbers, (1^2 + 2^2+3^2 ...... n^2)Sum square of n natural numbers, Sum cube of n natural numbers program in C language. Then today we will know about it through this program ... Sum of n natural numbers The Sum of n natural number formula are 1+2+3+....n = n(n+1)/2=(n^2+n)/2. The math.h header file is used in this program because the pow() function is defined in this header file. The function pow() syntax is double pow(double a , double b). The double is a data type in c language and it's also defined as %lf for input. In this program add= (k+x)/2 where are k=n^2 ,x=n. /*SUM OF N NATURAL NUMBERS*/ #include"stdio.h" #include"math.h" int main() { double x,y=2; printf("ENTER THE NATURAL NUMBER:"); scanf("%lf",&x); double n=pow(x,y); int add=(n...