Index of the first number divisible by 3
17 views (last 30 days)
Show older comments
How do I answer this using for loop, any hint or answer?
Write a script that given a vector, called A, of n numbers, outputs the index of the first number divisible by 3.
Sample Output: Given A = [5, 4, 6, 7, 3]
the answer should read as follow:
The index first number divisible by 3 is: 3
0 Comments
Answers (1)
See Also
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!