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
Why is c called c not d or e?
in iso what are the common technological language?
What is the difference between printf and scanf )?
Do character constants represent numerical values?
What is floating point constants?
Why & is used in scanf in c?
List the difference between a 'copy constructor' and a 'assignment operator' in C?
how to find binary of number?
Why dont c comments nest?
How many levels of pointers have?
What are file streams?
What is the correct code to have following output in c using nested for loop?
what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?
Are there namespaces in c?
What is the explanation for prototype function in c?