0

trying to figure out small error in code but cant manage,

Given three floating-point numbers x, y, and z, output x to the power of z, x to the power of (y to the power of 2), the absolute value of y, and the square root of (xy to the power of z). Output each floating-point value with two digits after the decimal point, which can be achieved as follows: printf("%0.2lf", yourValue); Ex: If the input is: 5.0 6.5 3.2 the output is: 172.47 340002948455826440449068892160.00 6.50 262.43 #include<stdio.h> #include<math.h> #include<stdlib.h> int main() { float x ,y ,z ; scanf("%f%f%f",&x,&y,&z); printf("%0.2lf",pow(x,z)); printf(" %0.2lf",pow(x,pow(y,2))); if (y < 0) { printf(" %0.2lf",-y); } else { printf(" %0.2lf",y); } printf(" %0.2lf\n",sqrt(pow(x*y, z))); return 0; } https://imgur.com/d2Z9OEq

3rd Sep 2020, 7:48 PM
Manesh Divedia
Manesh Divedia - avatar
5 Réponses
0
how would i fix it in order to make it run then sorry
4th Sep 2020, 12:33 AM
Manesh Divedia
Manesh Divedia - avatar
0
i understand makes more sense now, but when I run it in my assignment it stills shows error as for my expected output https://imgur.com/oAX80BI
4th Sep 2020, 3:24 PM
Manesh Divedia
Manesh Divedia - avatar