umm first reason
i decalred it as double and tried to use it as int
second reason is u cannot use cin >> if ur gonna give it the value yourself
and after u have used cin >> i beleive u cant use cin.get
try this
- Code: Select all
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
int dsecondnumber;
cout << "Are u 18? " << endl;
cin >> dsecondnumber ;
if (dsecondnumber < 18)
cout << "Access Granted \n";
else
cout << "lol nothing for you " << endl;
char f;
cin>>f;
return 0;
}
also just a suggestion:do not create Global variable unless u really need it
