Write a program that will tell the number of dogs and chickens.

preview_player
Показать описание
In this program, we take user input for the number of heads and legs. Then, we calculate the number of chickens assuming all animals are either dogs or chickens and dogs have 4 legs while chickens have 2 legs. We check if the solution is valid or not and print the result accordingly.
Рекомендации по теме