For which of the following situations is a nested loop required? It is a Multiple Select Question (MSQ).
1.To find the pair of students who have the same birthdays from the “Scores” dataset
2.To find the pair of students who scored the same marks in Physics from the “Scores” dataset
3.To find the number of words which have highest letter count from the “Words” dataset
4.To find the number of bills from the same shop from the “Shopping Bills” dataset
Answer: 3.To find the number of words which have highest letter count from the “Words” dataset.
nested loop is for counting letters in word, outer loop is for counting words
Comments
Leave a comment