+ 2
5 + 4 + 3 + 2 + 1 = 15. Output: Enter a number: 5. The sum of the first 5 integers is 15.
Syntax code pls
7 Réponses
+ 7
Celine V. Caballero You're looking for something like this?
https://code.sololearn.com/cHoq6O22sCDW/?ref=app
+ 4
Attempt first pls.
+ 3
Thankssss but I can't run it in this app
NosuchElement occurs T_T
+ 2
See a look to this program it will help you
https://code.sololearn.com/cP9eUt7l5EH7/?ref=app
+ 1
https://code.sololearn.com/cW75tlz62I3p/?ref=app
+ 1
Im shy🥺
+ 1
You will either need to use loops, or to know a trick to easily calculate 1 + 2 + ... + n