+ 1
How can we print negative number series in c++
2 Respostas
+ 4
#include <iostream>
using namespace std;
int main()
{
for(int i = 1; i <= 100; i++)
cout << i * (-1) << endl;
return 0;
}
+ 2
For this, you have to use loop. Your loop may start from -1 and decrement it one by one example- x = x-1. The loop should have a range upto which the loop executes.