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
If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?
What does the message "automatic aggregate intialization is an ansi feature" mean?
Write a Program to find whether the given number or string is palindrome.
A SIMPLE PROGRAM OF GRAPHICS AND THEIR OUTPUT I WANT SEE WAHAT OUTOUT OF GRAPHICS PROGRAM
What are the output(s) for the following ? #include char *f() {char *s=malloc(8); strcpy(s,"goodbye")} main() { char *f(); printf("%c",*f()='A'); }
Can you write a programmer for FACTORIAL using recursion?
in any language the sound structure of that language depends on its a) character set, input/output function, its control structures b) character set, library functions, input/output functions its control structures c) character set, library functions, control sturctures d) character set, operators, its control structures
What are the scope of static variables?
What is 'bus error'?
What is nested structure with example?
How can I prevent another program from modifying part of a file that I am modifying?
what are the 10 different models of writing an addition program in C language?
When is a void pointer used?
Differentiate between ordinary variable and pointer in c.
What is an auto variable in c?