Program to find the value of e raised to power x using while
loop
Answer Posted / pragathi
#include<stdio.h>
void main()
{
int i=1,e,x,s,p=1;
printf("Enter e and x :");
scanf("%d%d",&e,&x);
while(i<=x)
{
p=p*e;
i++;
}
printf("power is %d ",p);
}
here pow(e,x) is calculated using this program.
| Is This Answer Correct ? | 46 Yes | 40 No |
Post New Answer View All Answers
Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
How will you divide two numbers in a MACRO?
How can I recover the file name given an open stream?
Explain how can I convert a number to a string?
Why can’t we compare structures?
Why can't I perform arithmetic on a void* pointer?
Explain bitwise shift operators?
How #define works?
what is the significance of static storage class specifier?
any restrictions have on the number of 'return' statements that may be present in a function. a) no restriction b) only 2 return statements c) only 1 return statements d) none of the above
What does & mean in scanf?
Why c is a procedural language?
Why do some versions of toupper act strangely if given an upper-case letter?
What are the string functions? List some string functions available in c.
What is the function of volatile in c language?