0

Could some help me about this question

You have a lottery ticket, with ints a, b, and c on it. If the numbers are all different from each other, the result is 0. If all of the numbers are the same, the result is 20. If two of the numbers are the same, the result is 10. * Example: a. Input:a=1,b=2,c=3 Output: 0 b. Input: a = 2, b = 2, c = 2 Output: 20 c. Input: a = 1, b = 1, c = 2 Output: 10

16th Jun 2021, 4:41 AM
Kai Tsutsuki
Kai Tsutsuki - avatar
2 odpowiedzi
+ 3
Be like bill. show your attempt.
16th Jun 2021, 4:44 AM
Dino Wun (Use the search bar plz!)
Dino Wun (Use the search bar plz!) - avatar
0
Your problem is simple you need to use if esle conditions First take three input if u want to take numbers from user than use scanf or u can define like this int a=1,b=2 ,c=3; Then write conditions If((a==b)&&(a==c)&&(b==c) ) Result is 20 If ((a==b ) ||(a==c)) ||(b==c) print("two number are same")
16th Jun 2021, 8:23 AM
A S Raghuvanshi
A S Raghuvanshi - avatar