Hi everyone,This is my first article on this site, I hope you will enjoy it! :)What I'm going to show you today is a simple C++ virus, or scam (whatever you want to call it), that is very annoying once opened and requires a system reboot in order to stop it.What it actually does is very simple to understand:

  • It basically goes in an infinite loop, running only one command that makes the computer to continuously produce a very annoying sound, and because of that infinite loop, the program cannot be closed.
Without further introduction, here is the code:
#include <iostream>using namespace std;int main() {for(long long i=1;i<=100;i--)cout<<(char)7;}// very important, when saving this program, save it with this extension: ".cpp" and after getting its executable, you can troll whoever you want XD//notice that we started a loop with i=1 and set it to stop when i reaches 100, the only problem being that "i--", that creates the infinite loop
 Thank you for reading my article. I hope you enjoyed it!Best regards!

Start learning with Cybrary

Create a free account

Related Posts

All Blogs