cin command to use for inserting value on a function

后端 未结 2 1323
难免孤独
难免孤独 2021-01-28 07:19

How could I use cin to insert values for the function?

cin >> addNumber();
cout << addNumber() << endl;

I am not

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-28 08:19

    #include 
    
    using namespace std;
    
    int addNumber(int x, int y)
    {
        int answer = x + y;
        return answer;
    }
    
    int main()
    {   
        int x,y;
        cout<<"Enter first number"<>x;
        cout<<"Enter second number"<>y;    
        cout<

提交回复
热议问题