C program to define power of a function, C/C++ Programming

C program to define power of a function:

Write a program to use power of a function.

void main()

{

int x,y,po=1,i,j;

clrscr();

 

printf("Give x,y\n");

scanf("%d %d",&x,&y);

 

  for(i=1;i<=y;i++)

   {

   po=po*x;

   }

 

printf("%d power %d is %d",x,y,po);

getch();

}

Posted Date: 10/19/2012 3:02:30 AM | Location : United States







Related Discussions:- C program to define power of a function, Assignment Help, Ask Question on C program to define power of a function, Get Answer, Expert's Help, C program to define power of a function Discussions

Write discussion on C program to define power of a function
Your posts are moderated
Related Questions
Calculate the area of circle using c program: const float Pi = 3.1415926;   inline float area(const float r) {return Pi * r * r;}   main() {    float radius;

(RationalNumber Class) A rational number is a number that can be represented as the quotient of two integers. For example, 1/3, 5/7, 7/2, and so forth are rational numbers (By 2/1

In this we will take a closer look at the logic behind Object Oriented Programming.  Read through the pseudocode listed below and answer the following questions. Class Square

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

Program is to read the characters from keyboard: Program is to read the characters from keyboard one by one stored in different files as upper constants, lower constants, othe

Friend for Overloading Operators Sometimes friend functions cannot be avoided. For example with the operator overloading. Consider the following class that have data members to

Both malloc & new functions are utilized for dynamic memory allocations & the basic difference is: malloc need a special "typecasting" while it allocates memory for eg. if the poin

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

Use of random function: int main(void) {    int i,j;         for(j=0;j       {      // randomize();       for(i=0;i                  printf("%d\n", ran

Write a C program to input your full forename and full surname. e.g James McCarren and display in one string your complete initial and surname i.e J McCarren . Your initial should