Skip to content

Instantly share code, notes, and snippets.

@oykelrae
Created December 4, 2019 09:40
Show Gist options
  • Save oykelrae/4df8729303f2eef584c6cc4a4a19d13c to your computer and use it in GitHub Desktop.
Save oykelrae/4df8729303f2eef584c6cc4a4a19d13c to your computer and use it in GitHub Desktop.
Модуль числа
#include <stdio.h>
#include <math.h>
int main() {
double x, result;
printf("Введите число: ");
scanf("%lf", &x);
result = fabs(x);
printf("Модуль вашего числа = %.1lf\n", result);
return 0;
}
Введите число: -34
Модуль вашего числа = 34.0
Program ended with exit code: 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment