Saturday, 19 May 2018

Program to find power of a given number in c

/* power of given number */
# include<stdio.h>
void main ()
{
int a,b,pow=1,counter=0 ;
clrscr () ;
printf ("\n enter value of a:") ;
scanf ("%d",& a) ;
printf ("\n enter value of b:") ;
scanf ("%d",& b) ;
while (counter!=b)
{
pow =pow*a ;
counter++ ;
}
printf ("%d", pow) ;
getch () ;
}

No comments:

Post a Comment

Featured post

Kalgudi Interview Round!!

Those who cleared the second round of kalgudi got an email from exceller to complete their Kalgudi Interview Round. So here we will discuss ...