While Loop Homework Question
Show older comments
Hey everyone, I have a homework assignment due today and I can't figure out this question: Write a MATLAB repetition structure to determine how many terms in the sum 1+2+3+... are required for the sum to exceed one million (1e+6). Display how many terms are required and what is the first sum that exceeds one million in one sentence in the command window. Could someone help me out? I really can't find a way to figure it out so it would be awesome and really helpful is someone could help me.
2 Comments
Stephen23
on 4 Nov 2020
@Nicholas Bieganski: please show us what you have tried so far.
Nicholas Bieganski
on 4 Nov 2020
Accepted Answer
More Answers (1)
João Mendes
on 4 Nov 2020
0 votes
Can you use for loops? or only while?
1 Comment
Nicholas Bieganski
on 4 Nov 2020
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!