The absolute value seems to be the abs function, call it directly
If you don’t call it directly, use If else
If x is greater than 0, output it directly
< p>If x is less than 0, subtract x from 0 and assign it to y before outputting#include
#include
{
int x;
scanf("%d",&x);
x= abs(x);
printf("%d",x);
return 0;
}
#include< stdio.h>
#include
int main()
{
int x;
scanf("%d",&x);
if(x>=0)
{
printf("%d", x);
}
else
{
x=0-x;}
printf( "%d",x);
return 0;
}
Pay attention and tell me what you want ~
How to make a "very plain" PPT more "coquettish"? Like this:
How to beautify PPT