64 757
Assignments Done
99,3%
Successfully Done
In September 2018

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.
Expert's answer
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 first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions