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

What are the benefits of c language?

651


What is malloc return c?

603


How many levels deep can include files be nested?

656


What is a buffer in c?

580


What is sizeof array?

619






What is meant by high-order and low-order bytes?

659


What is stack in c?

619


which of the following statement is wrong a) mes=123.56; b) con='T'*'A'; c) this='T'*20; d) 3+a=b;

2420


Can we add pointers together?

622


i have to apply for rbi before that i need to know the the syllabus for the entrance questions. whethet it may be aps or techinical

1848


What is the use of printf() and scanf() functions?

640


What is size of union in c?

586


Sir,please help me out with the code of this question. Write an interactive C program that will encode or decode multiple lines of text. Store the encoded text within a data file, so that it can be retrieved and decoded at any time. The program should include the following features: (a) Enter text from the keyboard, encode the text and store the encoded text in a data file. (b) Retrieve the encoded text and display it in its encoded form. (c) Retrieve the encoded text, decode it and then display the decoded text. (d) End the computation. Test the program using several lines of text of your choice.

1772


What is #include stdio h and #include conio h?

605


What is the purpose of sprintf() function?

609