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 the red-black trees?
what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?
Why is not a pointer null after calling free? How unsafe is it to use (assign, compare) a pointer value after it is been freed?
What is the Purpose of 'extern' keyword in a function declaration?
what is the function of pragma directive in c?
How can you call a function, given its name as a string?
Can one function call another?
What is advantage of pointer in c?
What are categories used for in c?
What are pointers really good for, anyway?
Explain the difference between the local variable and global variable in c?
what is the diffrenet bettwen HTTP and internet protocol
Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]
Can two or more operators such as and be combined in a single line of program code?
How can you determine the maximum value that a numeric variable can hold?