C Program to caluclate power of number
#include#include void main() { float x,power=1,i; int y; clrscr(); printf("enter the base and power "); scanf("%f%d",&x,&y); for(i=1;i<=y;i++) power*=x; printf("\n%f raised to %d is %f",x,y,power); getch(); }
#include#include void main() { float x,power=1,i; int y; clrscr(); printf("enter the base and power "); scanf("%f%d",&x,&y); for(i=1;i<=y;i++) power*=x; printf("\n%f raised to %d is %f",x,y,power); getch(); }
If you face any Problem in viewing code such as Incomplete "For Loops" or "Incorrect greater than or smaller" than equal to signs then please collect from My Web Site CLICK HERE
More Useful Topics... |
|
No comments:
Post a Comment