what is wrong with this

#include "stdafx.h"
#include <iostream>


using namespace std;

int main()
{


int c,s,t.h;


cout << "Please enter the card number" << endl;
cin >> c;



if(c == "123")
{
cout << "Please enter the secret" << endl;
cin >> s;
if(c == "123")

cout << "your balance is : 120,000,000 do u want to take out some y/n ? "<< endl;
cin>t;

if (t =='y')
cout<<"how much?"<<endl;
cin>>h;
cout <<"ur new balance is : "<<120000000-h<<endl;
return0;
}
a lot of things
I have corrected some obvious things. If you have a number you don't use "" around it. You have two if() statements that don't surround anything...?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <iostream>

using namespace std;

int main()
{

//	int c,s,t.h; // error . instead of ,
	int c,s,t,h;

	cout << "Please enter the card number" << endl;
	cin >> c;

//	if(c == "123") // error
	if(c == 123) // c is a number, not a string
	{
		cout << "Please enter the secret" << endl;
		cin >> s;
//		if(c == 123) // What is this supposed to do?

		cout << "your balance is : 120,000,000 do u want to take out some y/n ? "<< endl;
		cin>t;

//		if (t =='y') // what is this supposed to do?
		cout<<"how much?"<<endl;
		cin>>h;
		cout <<"ur new balance is : "<<120000000-h<<endl;
		return0;
	}
}
Topic archived. No new replies allowed.