#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)
Re: is this an error 80 80

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

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

or this

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

Re: is this an error 80 80

thanks it worked

Re: is this an error 80 80

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

Re: is this an error 80 80

Assuming that balance is at least a floating point value, this is almost correct. Try this:

std::cout << "Your new balance is " << std::put_money((long double) balance) << std::endl;

Here is a good c++ reference: http://www.cplusplus.com/reference/

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.