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
What are the benefits of c language?
What is malloc return c?
How many levels deep can include files be nested?
What is a buffer in c?
What is sizeof array?
What is meant by high-order and low-order bytes?
What is stack in c?
which of the following statement is wrong a) mes=123.56; b) con='T'*'A'; c) this='T'*20; d) 3+a=b;
Can we add pointers together?
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
What is the use of printf() and scanf() functions?
What is size of union in c?
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.
What is #include stdio h and #include conio h?
What is the purpose of sprintf() function?