+ 1

C#Love chat-3

Give a heart to Mandy. Can I change a case if (answer == "yes") {PrintHeart();} else {WriteLine("Mandy is crying!");} To case with "?" operator? https://code.sololearn.com/cdzOdPkCRwth/?ref=app

10th Sep 2017, 12:55 PM
Топчий Анастасия Александровна
Топчий Анастасия Александровна - avatar
1 Respuesta
+ 1
No as PrintHeart and WriteLine returns void If you want to fix that, makes PrintHeart return an int for example and wrap WriteLine in another function
10th Sep 2017, 1:02 PM
Baptiste E. Prunier
Baptiste E. Prunier - avatar