1.5 실습

programming/c++ 2019. 3. 28. 09:20
#include 
#include 

using namespace std;

//합계 구하는 함수
void sum(int x, int y) 
{
cout << "your input sum is" << x+y <<endl;
}

int main()
{
int x, y;

cout << "type any number.\n" << endl;
cin >> x; //사용자 입력값 받는
cout << "your input is\n\n" << x << endl;

cout << "type any number.\n" << endl;
cin >> y;
cout << "your input is\n" << y << endl;

sum(x, y);

return 0;
}

'programming > c++' 카테고리의 다른 글

1.7 지역 범위  (0) 2019.03.29
1.6 키워드와 식별자 이름 짓기  (0) 2019.03.28
2019.03.24 - 함수와의 첫 만남  (0) 2019.03.25
2019.03.22 -입출력 스트림  (0) 2019.03.22
2918.03.21 - 프로그램 구조, 주석, 변수  (0) 2019.03.22
Posted by 도이(doi)
,