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