(c language) find x to the yth power

(C language) Find the yth power of x, input the values ​​of x and y, and y is an integer

#include<stdio.h>
#include<stdlib.h>
#include<math.h>//注意添加头文件 
int main(){
    
    
	double x,y;
	printf("请输入您所要进行计算的数据:\n") ;
	scanf("%lf %lf",&x,&y);
	printf("计算结果为:%lf",pow(x,y));
	//注意double对应%lf 
} 

Guess you like

Origin blog.csdn.net/WuwuwuH_/article/details/113752363