Showing posts with label raise. Show all posts
Showing posts with label raise. Show all posts

Wednesday, February 11, 2015

C program to raise any number x to a positive power n

C program to raise any number x to a positive power n

#include<stdio.h>
#include<conio.h>
#include<math.h>

void main()
{
int x,n,result;
clrscr(); //to clear the scrren
printf("Enter value of x and n:");
scanf("%d%d",&x,&n);
result=pow(x,n);
printf("
Result=%d",result);

getch(); //to stop the screen
}
Read more »