code_projects_c/STEP1_Basics/2_Arithmetic/main.c
2025-05-04 21:18:37 +03:00

27 lines
436 B
C

#include <stdio.h>
#include <math.h>
int main() {
float x, y;
printf("Enter x: "); scanf("%f", &x);
printf("Enter y: "); scanf("%f", &y);
float sum = x + y;
float sub = x - y;
float mult = x * y;
float div = x / y;
float poww = pow(x, y);
float sqrtt = pow(x, (1/y));
printf("Results:\n"
"sum: %f\n"
"sub: %f\n"
"mult: %f\n"
"div: %f\n"
"pow: %f\n"
"sqrt: %f\n",
sum, sub, mult, div, poww, sqrtt);
return 0;
}