#include <stdio.h>
#include <math.h> // Include math.h for sqrt() function
int main() {
double num, square, cube, squareRoot;
// Input the number from the user
// Calculate square, cube, and square root
square = num * num;
cube = num * num * num;
squareRoot
= sqrt(num
); // Using sqrt() from math.h to calculate the square root
// Output the results
printf("Square of %.2f is: %.2f\n", num
, square
); printf("Cube of %.2f is: %.2f\n", num
, cube
); printf("Square root of %.2f is: %.2f\n", num
, squareRoot
);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxtYXRoLmg+ICAvLyBJbmNsdWRlIG1hdGguaCBmb3Igc3FydCgpIGZ1bmN0aW9uCgppbnQgbWFpbigpIHsKICAgIGRvdWJsZSBudW0sIHNxdWFyZSwgY3ViZSwgc3F1YXJlUm9vdDsKCiAgICAvLyBJbnB1dCB0aGUgbnVtYmVyIGZyb20gdGhlIHVzZXIKICAgIHByaW50ZigiRW50ZXIgYSBudW1iZXI6ICIpOwogICAgc2NhbmYoIiVsZiIsICZudW0pOwoKICAgIC8vIENhbGN1bGF0ZSBzcXVhcmUsIGN1YmUsIGFuZCBzcXVhcmUgcm9vdAogICAgc3F1YXJlID0gbnVtICogbnVtOwogICAgY3ViZSA9IG51bSAqIG51bSAqIG51bTsKICAgIHNxdWFyZVJvb3QgPSBzcXJ0KG51bSk7ICAvLyBVc2luZyBzcXJ0KCkgZnJvbSBtYXRoLmggdG8gY2FsY3VsYXRlIHRoZSBzcXVhcmUgcm9vdAoKICAgIC8vIE91dHB1dCB0aGUgcmVzdWx0cwogICAgcHJpbnRmKCJTcXVhcmUgb2YgJS4yZiBpczogJS4yZlxuIiwgbnVtLCBzcXVhcmUpOwogICAgcHJpbnRmKCJDdWJlIG9mICUuMmYgaXM6ICUuMmZcbiIsIG51bSwgY3ViZSk7CiAgICBwcmludGYoIlNxdWFyZSByb290IG9mICUuMmYgaXM6ICUuMmZcbiIsIG51bSwgc3F1YXJlUm9vdCk7CgogICAgcmV0dXJuIDA7Cn0=