C language Su Xiaohong version 5.1 Input a real number arbitrarily from the keyboard without using the absolute value function to compile and calculate

#include<stdio.h>
int main()
{ float x; printf("Please enter a number:\n"); scanf("%f",&x); if(x>=0) printf("The real number The absolute value is:%f\n",x); else printf("The absolute value of the real number is:%f\n",-x); return 0; }








Guess you like

Origin blog.csdn.net/weixin_43462140/article/details/86565249