Why does this code only increment or decrement one variable but leave the other alone | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

Why does this code only increment or decrement one variable but leave the other alone

#include <iostream> Using namespace std; Int main() { int pos = 100; int neg = 100; for(pos=100; pos>=neg; pos++) for(neg = 100; neg<=pos; neg--) Cout << pos << " " << neg << endl; }

1st Sep 2023, 8:35 PM
Levi Saunders
Levi Saunders - avatar
0 Antworten