Practice Exercise 2
Question
Jatin and Shivam have 5 dogs each and dog's age are stored into an array (one array for each)
Create a program to result the dog is adult or puppy.
Criteria :
if age is greater than 3 then dog is adult otherwise, it is puppy.
Sample Data :
Jatin's Dogs : [5,1,3,4,2]
Shivam's Dogs : [2,2,3,1,5]
Hint
Create 2 for Loop from 1 to 5 for each dog's age check their age by using if condition and result the output.
If you are taking Numbers as the input in variable, then to consider it as a number you have to use parseInt function to convert var to Number
Solution:
Output