Programming Examples

Calculate the value of mx . Where ‘m’ is a mantissa and ‘x’ is an exponent


Write a program to enter mantissa and exponent. Calculate the value of mx . Where ‘m’ is a mantissa and ‘x’ is an exponent

Solution

#include<stdio.h>
void main()
{
int i,number,power;
long ans;
clrscr();
printf(“\n Enter Number :”);
scanf(“%d”,&number);
printf(“\n Enter Power :”);
scanf(“%d”,&power);
ans=1;
for(i=1;i<=power;i++)
ans*=number;
 printf(“\n The Power of %d raised to %d is %ld\n”, number,
power,ans);
getch();
}
Output

OUTPUT:

Enter Number : 5

Enter Power : 3

The Power of 5 raised to 3 is 125.

Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2026 Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Best Website and Software Company in Allahabad