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
What is the difference between void main and main in c?
What is the use of putchar function?
What are extern variables in c?
Why do we use return in c?
Why does this code crash?
What is difference between stdio h and conio h?
What is the use of typedef in structure in c?
what is the structure pointer?
What are the different file extensions involved when programming in C?
What is the heap in c?
What are qualifiers in c?
What is chain pointer in c?
Is c dynamically typed?
How can a program be made to print the name of a source file where an error occurs?
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.