Here you will get C++ program to print series 1 -4 7 -10 . . . . -40.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
#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; } |
thankyou
Hey thanks
1,2,4,7,10,……40 solve it plzz c++ way
Thank you. Its helped me complete a class assignment.
Hii sir, i have a doubt here can u plzz explain how this program print -4, and -10
Can you pls give its python program also
I want
Bluej programming
a program that inputs series of integers and passes them one at a time to a function even which uses the modulus operator (%) to determine if an integer is even. The function should take an integer argument and return 1 if the integer is even and 0 otherwise.