Program Of Star Pattern Print of 5 lines Reverse

Star Pattern 3


Star pattern 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 : Star Pattern3
      Filename : Star3.c
      IDE Used To Developed : CodeBlocks
      Developed By : Pavito Golui
  */
  #include<stdio.h>
  int main()
   {
        int i, j;

           for(i=5;i>=1;i--)
           {
                for(j=1;j<=5;j++)
                  {
                       if(j>=i)
                          printf(" * ");
                      else
                          printf("  ");
                }
                    printf("\n");     

      }
          return(1);
  
 

Output :


               * 
            * *           
         * * *
      * * * *
   * * * * * 



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.


Program Of Star Pattern Print of 5 lines

Star Pattern 2


Star pattern 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 : Star Pattern 2
      Filename : Star2.c
      IDE Used To Developed : CodeBlocks
      Developed By : Pavito Golui
  */
  #include<stdio.h>
  int main()
   {
        int i, j;

           for(i=1;i<=5;i++)
           {
                for(j=1;j<=5;j++)
                  {
                       if(j<=i)
                          printf("* ");
                      else
                          printf("  ");
                }
                    printf("\n");           }

          return(1);
  
 

Output :


  *
  * *
  * * *
  * * * *
  * * * * * 
 


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.


Program Power Of A Given Number

Program Power Of A Given Number

Power of given number 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 : Power Of Given Number
      Filename : power.c
      IDE Used To Developed : CodeBlocks
      Developed By : Pavito Golui
  */
  #include<stdio.h>
  int main()
   {
        int num, base, power, i=1;

         printf("Enter the number: ");
           scanf("%d",&num);
         printf("Enter the base: ");
           scanf("%d",&base);

           power=num;
         while(i<base);
         {
               
                 power=power*num;     
                  i++; 

         }      
         printf("Power of %d of base %d is %d",num,base,power);
          return(1);
  
 

Output :

  Enter the number: 5
  Enter the base: 2
  Power of 5 of base 2 is 25


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.


Program Sum Of First N Odd Natural Number

Program Sum Of First N Odd Natural Number

Sum of first N even natural number 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 N odd natural  number
      Filename : sumOddNo.c
      IDE Used To Developed : CodeBlocks
      Developed By : Pavito Golui
  */
  #include<stdio.h>
  int main()
   {
        int oddsum=0, i=1, num, tovalue;

         printf("Enter value for N: ");
           scanf("%d",&num);
           tovalue=num*2;
         while(i<tovalue);
         {
                if(i%2!=0)
                     {
                         oddsum=oddsum+i;
                     }      
                  i++; 

         }      
         printf("Sum of  %d odd No is %d: ",num,oddsum);
          return(0);
  
 

Output :

  Enter value for N: 3
  Sum of 5 odd No is: 9


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.


Program Sum Of First N Even Natural Number

Program Sum Of First N Even Natural Number

Sum of first N even natural number 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 N even natural  number
      Filename : sumEvenNo.c
      IDE Used To Developed : CodeBlocks
      Developed By : Pavito Golui
  */
  #include<stdio.h>
  int main()
   {
        int evensum=0, i=2, num, tovalue;

         printf("Enter value for N: ");
           scanf("%d",&num);
           tovalue=num*2;
         while(i<=tovalue);
         {
                if(i%2==0)
                     {
                         evensum=evensum+i;
                     }      
                  i++; 

         }      
         printf("Sum of  %d even No is %d: ",num,evensum);
          return(0);
  
 

Output :

  Enter value for N: 5
  Sum of 5 even No is: 30


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.


Program Of Factorial Of A Given Number

Program Of Factorial Of A Given Number

Factorial of a given number 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 : factorial of a number
      Filename : factorial.c
      IDE Used To Developed : CodeBlocks
      Developed By : Pavito Golui
  */
  #include<stdio.h>
  int main()
   {
        int fact=1, i=1,num;

         printf("Enter a number : ");
           scanf("%d",&num);
         if(num==0);
        else
         {
             while(i<=num)
                { 
                   fact=fact*i;
                   i++;      
                 }

        }      
         printf("Factorial of %d is %d",num,fact);
          return(0);
  
 

Output :

  Enter a number: 5
  Factorial of 5 is 120 


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.


Program Product Of First N Natural Number

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.