+ 2

5 + 4 + 3 + 2 + 1 = 15. Output: Enter a number: 5. The sum of the first 5 integers is 15.

Syntax code pls

21st Oct 2020, 1:09 PM
Celine V. Caballero
Celine V. Caballero - avatar
7 Réponses
21st Oct 2020, 1:14 PM
Simba
Simba - avatar
+ 4
Attempt first pls.
21st Oct 2020, 1:10 PM
QTWizard
+ 3
Thankssss but I can't run it in this app NosuchElement occurs T_T
21st Oct 2020, 1:27 PM
Celine V. Caballero
Celine V. Caballero - avatar
+ 2
See a look to this program it will help you https://code.sololearn.com/cP9eUt7l5EH7/?ref=app
23rd Oct 2020, 12:37 PM
Ashutosh Kumar [ Falcon Coding ]
Ashutosh Kumar  [ Falcon Coding ] - avatar
+ 1
https://code.sololearn.com/cW75tlz62I3p/?ref=app
21st Oct 2020, 1:13 PM
Celine V. Caballero
Celine V. Caballero - avatar
+ 1
Im shy🥺
21st Oct 2020, 1:13 PM
Celine V. Caballero
Celine V. Caballero - avatar
+ 1
You will either need to use loops, or to know a trick to easily calculate 1 + 2 + ... + n
21st Oct 2020, 1:16 PM
Seb TheS
Seb TheS - avatar