본문 바로가기

C언어

8. 절대값 출력

#include <stdio.h>
void main() {
int a,b,c;

printf("정수 입력: ");
scanf("%d",&a);

if(a<0)
a=-a;
printf("%d",a);
}