Computer >> 컴퓨터 >  >> 프로그램 작성 >> C 프로그래밍

두 개의 정수를 더하는 C 프로그램

<시간/>

두 개의 숫자를 더하는 프로그램은 숫자를 가져와서 수학적인 합을 계산하고 그 합을 저장하는 다른 변수에 제공합니다.

예시 코드

#include <stdio.h>
int main(void) {
   int a = 545;
   int b = 123;
   printf("The first number is %d and the second number is %d \n", a , b);
   int sum = a + b;
   printf("The sum of two numbers is %d" , sum);
   return 0;
}

출력

The first number is 545 and the second number is 123
The sum of two numbers is 668