Answer to Question #49837 in C++ for yousuf waseem

Question #49837
Write a program output a rotating fan on the screen. This is done by printing first a Plus sign in the center of the screen,i.e. plus and multiply sign.
1
Expert's answer
2015-06-05T04:07:34-0400
Code. 
#include <iostream>
#include <windows.h>
#include <conio.h>
 
using namespace std;
 
int main() {
    for (int i = 0; i < 100; i++) {
       cout << " | \n";
       cout << "-+-\n";
       cout << " | ";
       Sleep(500);
       system("clear");
       cout << "\\ /\n";
       cout << " x \n";
       cout << "/ \\";
       Sleep(500);
       system("clear");
    }
 
    return 0;
}
Input/Output.
 |
-+-
 |
or
\ /
  ×
/ \
 
 
+
 
 x
 

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS