+ 1

Loop in c++ and python

python: import time a = 0 while a <= 100; print(a) a += 1 time.sleep(1) c++: #include <iostream> #include <unistd.h> using namespace std; int main() { int a; a = 1; while (a < 100){ cout << a; a++; usleep(1000000); } } why in c++ we must wait until a = 100. i want like python, so each after a + 1, it will print a. how to do that?

3rd Oct 2017, 1:29 AM
Kevin AS
Kevin AS - avatar
1 Answer
+ 2
Just make do. You can't do anything. Python is more of a spoonfeeding language
3rd Oct 2017, 4:32 AM
👑 Prometheus 🇾🇬
👑 Prometheus 🇾🇬 - avatar