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
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.
What is the difference between struct and typedef struct in c?
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
which type of aspect you want from the student.
c language interview questions & answer
What is a lvalue
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.
What is malloc calloc and realloc in c?
Explain how can type-insensitive macros be created?
How can I split up a string into whitespace-separated fields?
How many keywords (reserve words) are in c?
Can main () be called recursively?
Is javascript written in c?
Explain what is the difference between a string and an array?
What is spaghetti programming?