current position:Home>Programming with C language to find the Y power of X

Programming with C language to find the Y power of X

2022-02-02 20:24:20 CSDN Q & A

use c Language programming for x Of y Power , And write the main tone function




Refer to the answer 1:

#include<stdio.h>
#include<math.h>
int main()
{
int x,y,z;
scanf("%d%d",&x,&y);
z=pow(x,y);
printf("%d",z);
return 0;
}




Refer to the answer 2:



Refer to the answer 3:

img




Refer to the answer 4:



Refer to the answer 5:
#include<stdio.h>int res(int x,int y) {    int resNum = 1;    for (int i = 0; i < y; i++)    {        resNum *= x;    }    return resNum;}int main(){    int x = 0,y = 0;    scanf("%d%d",&x,&y);    printf("%d\n",res(x,y));    return 0;}



Refer to the answer 6:

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.primo.wiki/2022/02/202202022024191601.html

Random recommended