Program Product Of First N Natural Number

Product of first N natural numbers program in C
This is our first program in C programming language. This C program will print the text
“Hello World!” on the console output screen. In this post we will learn how to 
write a C Program and explore each statements in this C Program and many more.



  /*
      Program : Sum Of First N Natural Numbers
      Filename : productNNaturalNum.c
      IDE Used To Developed : CodeBlocks
      Developed By : Pavito Golui
  */
  #include<stdio.h>
  int main()
   {
        int product=1,num,i=1;
         printf("Enter a value for N : ");
           scanf("%d",&num);
         while(i<=num)
           { 
                product=product*i;
                 i++;      
         
         printf("Product of N number is=%d",product);
          return(0);
  
 

Output :

  Enter a value for N :8
  Product of N Number is=40320 


Explanation Of Each Statements In The Program:-
To learn any programming language, practical is must important than others factors. First of
all we learn and understand the language and then we implements, each things related to 
the language and explore about it. After all we are interested in making products (Software)
by using that language.


Previous Post
Next Post
Related Posts