Program to find the value of e raised to power x using while
loop

Answer Posted / pragathi

#include<stdio.h>
void main()
{
int i=1,e,x,s,p=1;
printf("Enter e and x :");
scanf("%d%d",&e,&x);
while(i<=x)
{
p=p*e;
i++;
}

printf("power is %d ",p);
}

here pow(e,x) is calculated using this program.

Is This Answer Correct ?    46 Yes 40 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is 1d array in c?

604


How will you print TATA alone from TATA POWER using string copy and concate commands in C?

924


What is context in c?

543


Explain what is the benefit of using an enum rather than a #define constant?

728


Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create.

1484






Explain how can a program be made to print the name of a source file where an error occurs?

693


what does static variable mean?

659


What are predefined functions in c?

572


Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.

673


write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.

2273


What is strcpy() function?

662


What does sizeof function do?

623


What is the difference between %d and %i?

600


What is a program flowchart and how does it help in writing a program?

669


What do you mean by command line argument?

650