메뉴 건너뛰기

Programing

C언어 게시판

기본연산자 사용

관리자2 2018.12.17 19:24 조회 수 : 204

#include <stdio.h>

 

int main() {

setvbuf(stdout, NULL, _IONBF, 0);

 

  

  int a = 10;

  int b = 3;

  

  float c = 1.5;

  float d = 2.5;

  

  printf("덧셈 : ");

  printf("a + b = %d \n", a + b);

  

  printf("뺄셈 : ");

  printf("a - b = %d \n", a - b);

  printf("b - a = %d \n", b - a);

  

  printf("곱셈 : ");

  printf("c * d = %f \n", c * d);  

  

  printf("나눗셈 : ");

  printf("c / d = %f \n", c / d);

  

  printf("나머지 : ");

  printf("a %% b = %d \n", a % b); 

 

 

  return 0;

}

기본연산자 사용하기
위로