Computer Science, asked by nsaveetha1977, 8 months ago

write a python program to print the following series 1,-4,7,-10,........-40

Answers

Answered by navin21112006
0

Answer:

The python program to print number 1, 4, 7, ...... , 40

#include<iostream>

using namespace std;  

int main()

{

int i,a=-1,b;

for(i=1;i<=40;i+=3)

{

a*=-1;

b=i;

b*=a;

cout<<b<<" ";

}  

return 0;

}

Explanation:

Hoping that you understood this program.

Pls mark me as a brainliest .

Similar questions