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


Please Help Members By Posting Answers For Below Questions

write a program that reads lines(using getline), converts each line to an integer using atoi, and computes the average of all the numbers read. also compute the standard deviation.

1981


What is the difference between struct and typedef struct in c?

657


we called a function and passed something do it we have always passed the "values" of variables to the called function. such functions calles are called a) calls by reference b) calls by value c) calls by zero d) none of the above

633


which type of aspect you want from the student.

1701


c language interview questions & answer

1457






What is a lvalue

664


Create a structure to specify data on students as given below: Roll number, Name, Department, Course, and Year of joining. Assume that there are not more than 450 students in the collage. (a) Write a function to print the names of all students who joined in the last 3 years. (b) Write a function to print the data of a student whose roll numbers are divisible by 4.

596


What is malloc calloc and realloc in c?

666


Explain how can type-insensitive macros be created?

570


How can I split up a string into whitespace-separated fields?

569


How many keywords (reserve words) are in c?

618


Can main () be called recursively?

627


Is javascript written in c?

582


Explain what is the difference between a string and an array?

638


What is spaghetti programming?

670