Answer the question
In order to leave comments, you need to log in
What will be the result of the flowchart?
What will happen as a result if 1, 1, 1, 0, 0, 1, 0, 1, 1 is passed to the input
? next loop) check x[i] = 1? How can x[i] be equal to one if it's an array of numbers?
I would be grateful for an answer and an explanation.
Answer the question
In order to leave comments, you need to log in
The first loop reads the input into the array x. Your "1, 1, 1, 0, 0, 1, 0, 1, 1" will be in this array (you just need to enter 9 as n first).
Therefore, testing for 1 makes sense and will return true for the first three iterations, but not for the next two, and so on.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question