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

What is the difference between void main and main in c?

618


What is the use of putchar function?

646


What are extern variables in c?

539


Why do we use return in c?

560


Why does this code crash?

610






What is difference between stdio h and conio h?

876


What is the use of typedef in structure in c?

536


what is the structure pointer?

1639


What are the different file extensions involved when programming in C?

745


What is the heap in c?

635


What are qualifiers in c?

568


What is chain pointer in c?

595


Is c dynamically typed?

663


How can a program be made to print the name of a source file where an error occurs?

722


7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.

2214