0
How run infinite loops on c++
#include <bits/std c++.h> Using namespace ; int main(){ Int i = 1; While (i <= 100){ Cout << I; i++; return(); }
4 Answers
+ 8
int i = 0;
while(true) {
cout << i++;
}
+ 6
Please use relevant tags for your post
And follow this guide next time you submit a post
https://www.sololearn.com/Discuss/333866/?ref=app
https://code.sololearn.com/W3uiji9X28C1/?ref=app
+ 3
there's also the old classic
for(;;){}
or even something fancier like
void loop(){
loop();
}
PS if you really want to give your computer a hard time don't forget to throw in some malloc abuse and pointers accessing random memory locations
+ 1
Rob Newman surprisingly real answer: learning how to break something on purpose is often the best way to learn how not to break it by accident