#include<stdio.h>
#include<conio.h>
void main()
{
int bas, exp, count = 1, power = 1 ;
clrscr() ;
printf("Enter the value of base number: ") ;
scanf("%d", &bas) ;
printf("\nEnter the value of exponent : ") ;
scanf("%d", &exp) ;
while(count <= exp)
{
power = power * bas ;
count ++ ;
}
printf("\nThe value of %d power %d = %d", bas, exp, power) ;
getch() ;
}
#include<conio.h>
void main()
{
int bas, exp, count = 1, power = 1 ;
clrscr() ;
printf("Enter the value of base number: ") ;
scanf("%d", &bas) ;
printf("\nEnter the value of exponent : ") ;
scanf("%d", &exp) ;
while(count <= exp)
{
power = power * bas ;
count ++ ;
}
printf("\nThe value of %d power %d = %d", bas, exp, power) ;
getch() ;
}
No comments:
Post a Comment