notahipee said:
no it isn't
#include <iostream>
#include <ostream>
int main()
{
int a;
cout << "enter a number " << endl;
cin >> a;
switch (a)
{
case 00: cout << zero;
case 01: cout << zero one;
case 02: cout << zero two;
case 03: cout << zero three;
case 04: cout << zero four;
case 05: cout << zero five;
case 06: cout << zero six;
case 07: cout << zero seven;
case 08: cout << zero eight;
case 09: cout << zero ninne;
}
return 0;
}
my compiler gives
C:\bin\nota.cpp(8) : error C2065: 'cout' : undeclared identifier
C:\bin\nota.cpp(8) : error C2297: '<<' : bad right operand
C:\bin\nota.cpp(8) : error C2065: 'endl' : undeclared identifier
C:\bin\nota.cpp(9) : error C2065: 'cin' : undeclared identifier
C:\bin\nota.cpp(13) : error C2065: 'zero' : undeclared identifier
C:\bin\nota.cpp(14) : error C2146: syntax error : missing ';' before
identifier 'one'
C:\bin\nota.cpp(14) : error C2065: 'one' : undeclared identifier
C:\bin\nota.cpp(15) : error C2146: syntax error : missing ';' before
identifier 'two'
C:\bin\nota.cpp(15) : error C2065: 'two' : undeclared identifier
C:\bin\nota.cpp(16) : error C2146: syntax error : missing ';' before
identifier 'three'
C:\bin\nota.cpp(16) : error C2065: 'three' : undeclared identifier
C:\bin\nota.cpp(17) : error C2146: syntax error : missing ';' before
identifier 'four'
C:\bin\nota.cpp(17) : error C2065: 'four' : undeclared identifier
C:\bin\nota.cpp(18) : error C2146: syntax error : missing ';' before
identifier 'five'
C:\bin\nota.cpp(18) : error C2065: 'five' : undeclared identifier
C:\bin\nota.cpp(19) : error C2146: syntax error : missing ';' before
identifier 'six'
C:\bin\nota.cpp(19) : error C2065: 'six' : undeclared identifier
C:\bin\nota.cpp(20) : error C2146: syntax error : missing ';' before
identifier 'seven'
C:\bin\nota.cpp(20) : error C2065: 'seven' : undeclared identifier
C:\bin\nota.cpp(21) : error C2041: illegal digit '8' for base '8'
C:\bin\nota.cpp(21) : error C2146: syntax error : missing ';' before
identifier 'eight'
C:\bin\nota.cpp(21) : error C2065: 'eight' : undeclared identifier
C:\bin\nota.cpp(22) : error C2041: illegal digit '9' for base '8'
C:\bin\nota.cpp(22) : error C2146: syntax error : missing ';' before
identifier 'ninne'
C:\bin\nota.cpp(22) : error C2065: 'ninne' : undeclared identifier
you also misssed all the breaks out of your switch statement.
I can't see what "zero one" is supposed to mean in
case 01: cout << zero one;
wouldn't
case 01: cout << "zero one";
make more sense?