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.


Previous Post
Next Post
Related Posts