Program to find the value of e raised to power x using while
loop
Answer Posted / tirtharaj dash
#include<stdio.h>
#include<conio.h>
#define e 2.718281828
int main()
{
double ex=e;
int x,i=0;
printf("\nenter the power : ");
scanf("%d",&x);
while(i++!=x-1)
{
ex*=e;
}
printf("\nthe result is : %f",ex);
getch();
return 0;
}
/*i hope u get the logic.....TR dash*/
note:--->run in dev C++ / TC
| Is This Answer Correct ? | 9 Yes | 17 No |
Post New Answer View All Answers
Lists the benefits of c programming language?
What does *p++ do?
How does free() know explain how much memory to release?
What are the advantages of c preprocessor?
How can I make sure that my program is the only one accessing a file?
What is the use of printf() and scanf() functions?
What is the difference between exit() and _exit() function?
WHAT IS THE DEFINATION OF IN TECHNOLOGY AND OFF TECHNOLOGY ?
Can you explain what keyboard debouncing is, and where and why we us it? please give some examples
What is the c value paradox and how is it explained?
How can I convert a number to a string?
5 Write an Algorithm to find the maximum and minimum items in a set of ānā element.
Why is extern used in c?
What is the hardest programming language?
Why c is called a middle level language?