Write a short program to print the following series:
1 4 7 10......40
Answers
Answer:
Hey mate, Here's your answer
To print the following series you should first open your computer that have MS Excel. The follow these steps:-
Explanation:
1. Type 1 in the cell A1 or any cell from where you want to start the series.
2. Type 4 in the next cell that is below the cell that contains 1.
3. Now select these two cells.
4. Then take your mouse pointer to the right bottom corner of the cell that contains 4. (The two cell should be selected)
5. Then drag from that corner to the cell where you wants to end the series.
6. The series will be insertes with uniform gap like 1,4,7 .... and more.
Hope it helps you.
Mar it as brainliest.
Python Program :
Explanation:
r=int(input("Enter the last term: ")) #take the input for the last term.
i=1
while(i<=r):#while loop to print the series.
print(i,end=" ")
i=i+3
Output :
- If the user input as 7, then the output is "1 4 7".
- If the user input as 40, then the output comes which is defined above.
Code Explanation :
- The above code is in python, which take the input for the last term.
- Then the while loop runs until it will not get the last term and print the series.
Learn More :
- Python : https://brainly.in/question/14689905