0

You are making a robot that can speak numbers. Your robot should take 3 numbers in the range of 0-10 as input and output the c

You are making a robot that can speak numbers. Your robot should take 3 numbers in the range of 0-10 as input and output the corresponding texts in English. Sample Input: 8 0 5 Sample Output: Eight Zero Five How to make Program ??

17th May 2021, 1:00 PM
Vrushabh
Vrushabh - avatar
10 Answers
+ 11
package main import "fmt" func main() { //your code goes here for i := 1; i<=3; i++{ var i int fmt.Scanln(&i) switch i { case 0: fmt.Println("Zero") case 1: fmt.Println("One") case 2: fmt.Println("Two") case 3: fmt.Println("Three") case 4: fmt.Println("Four") case 5: fmt.Println("Five") case 6: fmt.Println("Six") case 7: fmt.Println("Seven") case 8: fmt.Println("Eight") case 9: fmt.Println("Nine") case 10: fmt.Println("Ten") default: fmt.Println(i) } } }
7th Jun 2021, 5:51 PM
Vrushabh
Vrushabh - avatar
0
use switch for that in " C "!
17th May 2021, 1:18 PM
Giriraj Yalpalwar
Giriraj Yalpalwar - avatar
0
This challenge is similar to the code coach No Numerals, except for multiline inputs. If you have done the code coach challae you only have to loop the input for some interval, in this case 3.
17th May 2021, 1:31 PM
Endalk
Endalk - avatar
0
Vrushabh Dhanraj Lewade just loop over the switch take user input inside and the range of the loops should be 3
17th May 2021, 2:15 PM
Atul [Inactive]
0
Thank you so much .
17th May 2021, 5:53 PM
Vrushabh
Vrushabh - avatar
0
Please help me aut can someone send me full code
7th Jun 2021, 4:46 PM
Asad Younas
Asad Younas - avatar
0
Vrushabh Dhanraj lewade thank you so much bro
7th Jun 2021, 7:21 PM
Asad Younas
Asad Younas - avatar
0
My pleasure
8th Jun 2021, 9:36 AM
Vrushabh
Vrushabh - avatar
0
package main import "fmt" func main() { //your code goes here var i int fmt.Scanln(&i) switch i { case 1: fmt.Println("One") case 2: fmt.Println("Two") case 3: fmt.Println("Three") case 4: fmt.Println("Four") case 5: fmt.Println("Five") case 6: fmt.Println("Six") case 7: fmt.Println("Seven") case 8: fmt.Println("Eight") case 9: fmt.Println("Nine") case 10: fmt.Println("Ten") } var b int fmt.Scanln(&b) switch b { case 1: fmt.Println("One") case 2: fmt.Println("Two") case 3: fmt.Println("Three") case 4: fmt.Println("Four") case 5: fmt.Println("Five") case 6: fmt.Println("Six") case 7: fmt.Println("Seven") case 8: fmt.Println("Eight") case 9: fmt.Println("Nine") case 10: fmt.Println("Ten") } var c int fmt.Scanln(&c) switch c { case 1: fmt.Println("One") case 2: fmt.Println("Two") case 3: fmt.Println("Three") case 4: fmt.Println("Four") case 5: fmt.Println("Five") case 6: fmt.Println("Six") case 7: fmt.Println("Seven") case 8: fmt.Println("Eight") case 9: fmt.Println("Nine") case 10: fmt.Println("Ten") } } IT WORKS BUT TEST CASE 3 WRITES THAT IT'S WRONG!!! WHY?
19th May 2022, 9:01 AM
Mari
0
package main import "fmt" func main() { for i:=1;i<4;i++ { var i int fmt.Scanln(&i) switch i { case 0: fmt.Println("Zero") case 1: fmt.Println("One") case 2: fmt.Println("Two") case 3: fmt.Println("Three") case 4: fmt.Println("four") case 5: fmt.Println("Five") case 6: fmt.Println("Six") case 7: fmt.Println("Seven") case 8: fmt.Println("Eight") case 9: fmt.Println("Nine") case 10: fmt.Println("Ten") default: fmt.Println(i) } } } somewhat test case 3 is still not solved.
15th Jun 2022, 2:55 PM
patel sagarkumar
patel sagarkumar - avatar