Q1.Write a program to input the value of n and print all the numbers from 1 to n in a series as follows: [2.5]
Answers
Answered by
1
Answer:
problem solution
1. Take a value from the user and store it in a variable n.
2. Use a for loop where the value of i ranges between the values of 1 and n.
3. Print the value of i and ‘+’ operator while appending the value of i to a list.
4. Then find the sum of elements in the list.
5. Print ‘=’ followed by the total sum.
6. Exit.
plz mark it as BRAINLIEST answer
Attachments:
Similar questions