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
In C language what is a 'dangling pointer'?
Does free set pointer to null?
What is scanf () in c?
write a program in c language to print your bio-data on the screen by using functions.
What is the function of this pointer?
What is the significance of an algorithm to C programming?
what is the c source code for the below output? 10 10 10 10 10 10 10 10 10 10 9 9 7 6 6 6 6 6 6 9 7 5 9 7 3 2 2 5 9 7 3 1 5 9 7 3 5 9 7 4 4 4 4 5 9 7 8 8 8 8 8 8 8 8 9
What is the process to generate random numbers in c programming language?
What is the difference between local variable and global variable in c?
What the advantages of using Unions?
Explain what is the difference between a free-standing and a hosted environment?
In c programming write a program that will print 10 multiples of 3 except 15,18,21 using looping
Is return a keyword in c?
write a program to input 10 strings and compare without using strcmp() function. If the character of one string matches with the characters of another string , sort them and make it a single string ??? example:- str1="Aakash" st2="Himanshu" str="Uday" output:- Aakashimanshuday (please post the answer as quickly as possible)
How can I invoke another program (a standalone executable, or an operating system command) from within a c program?