I need help with the if else if ladder.
Here is my problem:
I never got to finish the if else if ladder, because my compiler already gives an
incorrect syntax.
Here is my problem:
Code:
#include <iostream>
using namespace std;
int main()
{
int lyle, dunn, charles, name;
cout << "enter name:\n";
cin >> name;
if(name == 1) cout << "enter dunn:\n";
cin >> dunn;
cout << dunn * 2;
else if(name == 2) cout << "enter lyle:\n";
cin >> lyle;
cout << lyle * 2;
cin.get();
cin.get();
return 0;
incorrect syntax.
Comment