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


Please Help Members By Posting Answers For Below Questions

Explain the red-black trees?

607


what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?

1905


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?

602


What is the Purpose of 'extern' keyword in a function declaration?

654


what is the function of pragma directive in c?

625






How can you call a function, given its name as a string?

714


Can one function call another?

628


What is advantage of pointer in c?

690


What are categories used for in c?

568


What are pointers really good for, anyway?

614


Explain the difference between the local variable and global variable in c?

602


what is the diffrenet bettwen HTTP and internet protocol

1390


Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]

632


Can two or more operators such as and be combined in a single line of program code?

808


How can you determine the maximum value that a numeric variable can hold?

639