0
#include <iostream>

using namespace std;

int main()
{
const int pin1 = 123;
  const int accnum1= 23;
  int pin;
  int accnum;
    cout << "Enter Pin" <<endl;
    cin >> pin;
    cout << "Enter account number" <<endl;
    cin >> accnum;
    if (pin1 == pin) && (accnum1 == accnum) // line 15
        {
            cout<<" you passed";
        }
        return 0;




    it says there is an error at line 15(indicated)
2
Contributors
4
Replies
6
Views
2 Years
Discussion Span
Last Post by rubberman
0

Yes. It needs to be either of these two ways:

if (pin1 == pin && accnum1 == accnum)

or this

if ((pin1 == pin) && (accnum1 == accnum))

0

Also how can i concatenate a sentence with the output of a variable
eg. cout << "Your new balance is" << balance <<endl;

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.