There are 2 matches to be held in the final round of La Liga(a football season/tournament) which determine the winner of the tournament. In order for Barcelona to win the title,it must win its game and Real Madrid must lose its game. Given the goals scored by each of the teams in both the matches, tell who is going to win the title.
Store the number of goals scored by each of the team. See who wins the matches between the teams and check if the given condition is true.
So the first step will idealy be to store the scores of each team.
Now you have the scores of each team. So you need to check -
1. Barcelona won its game: We can check this if barca > eibar. 2. Real Madrid loses to Malaga: We can check this if real < malaga
So if these 2 conditions are true then the answer is ‘Barcelona’ else it is ‘RealMadrid’.