subject

My code here is written to write a two-digit number in words, everything works as intended except when I enter the number 10-19, it will do what it is supposed to but then print the word for a number in the 20s. It would be greatly appreciated if you could take a look at the code ```
#include
#include
using namespace std;
int main() {

int number, first, second;

cout<<"Enter a two digit number:";
cin>>number;

first=floor(number/10);
second=floor(number%10);

switch(first){
case 1: switch(second){
case 0:cout<<"The number entered is ten";break;
case 1:cout<<"The number entered is eleven";break;
case 2:cout<<"The number entered is twelve";break;
case 3:cout<<"The number entered is thirteen";break;
case 4:cout<<"The number entered is fourteen";break;
case 5:cout<<"The number entered is fifteen";break;
case 6:cout<<"The number entered is sixteen";break;
case 7:cout<<"The number entered is seventeen";break;
case 8:cout<<"The number entered is eighteen";break;
case 9:cout<<"The number entered is ninteen";break;
return 0;
}
case 2:cout<<"The number entered is twenty";break;
case 3:cout<<"The number entered is thirty";break;
case 4:cout<<"The number entered is fourty";break;
case 5:cout<<"The number entered is fifty";break;
case 6:cout<<"The number entered is sixty";break;
case 7:cout<<"The number entered is seventy";break;
case 8:cout<<"The number entered is eighty";break;
case 9:cout<<"The number entered is nintey";break;
}
switch(second) {
case 0: break;
case 1:cout<<"-one";break;
case 2:cout<<"-two";break;
case 3:cout<<"-three";break;
case 4:cout<<"-four";break;
case 5:cout<<"-five";break;
case 6:cout<<"-six";break;
case 7:cout<<"-seven";break;
case 8:cout<<"-eight";break;
case 9:cout<<"-nine";break;

}

return 0;
}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 16:00
What tool can discover and report computer errors and conflicts that occur when you first turn on a computer and before the operating system?
Answers: 1
question
Computers and Technology, 23.06.2019 11:00
In the context of the box model, what is the difference between a margin and a padding? a. a padding lies outside a box border, while a margin lies inside it. b. a padding lies inside a box border, while a margin lies outside it. c. a padding can be adjusted independently, while a margin depends on the size of its box. d. a padding depends on the size of its box, while a margin can be adjusted independently.
Answers: 3
question
Computers and Technology, 23.06.2019 17:30
Per the municipal solid waste report, what are the most common sources of waste (trash
Answers: 3
question
Computers and Technology, 23.06.2019 19:30
2. fluorine and chlorine molecules are blamed fora trapping the sun's energyob forming acid rainoc producing smogod destroying ozone molecules
Answers: 2
You know the right answer?
My code here is written to write a two-digit number in words, everything works as intended except wh...
Questions
question
Mathematics, 02.03.2021 19:50
question
Mathematics, 02.03.2021 19:50
question
Mathematics, 02.03.2021 19:50
question
Mathematics, 02.03.2021 19:50
question
Mathematics, 02.03.2021 19:50
Questions on the website: 13722363