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
What is echo in c programming?
How can a string be converted to a number?
What is structure in c definition?
What is sizeof int in c?
Explain what is a program flowchart and explain how does it help in writing a program?
What is the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.
I have seen function declarations that look like this
How do shell structures work?
What is c language and why we use it?
Write a program to know whether the input number is an armstrong number.
what are the different storage classes in c?
What is meant by initialization and how we initialize a variable?
Who developed c language?
What is meant by realloc()?
What are the different types of data structures in c?