Q:

Write a program in C++ to print an American flag on the screen

0

Write a program in C++ to print an American flag on the screen

Sample Output:

 Print the American flag:                                              
-----------------------------                                          
* * * * * * ==================================                         
 * * * * *  ==================================                         
* * * * * * ==================================                         
 * * * * *  ==================================                         
* * * * * * ==================================                         
 * * * * *  ==================================                         
* * * * * * ==================================                         
 * * * * *  ==================================                         
* * * * * * ==================================                         
==============================================                         
==============================================                         
==============================================                         
==============================================                         
==============================================                         
==============================================

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#include <iostream>
using namespace std;
 
int main()
{
    cout << "\n\n Print the American flag:\n";
	cout << "-----------------------------\n";
	     cout <<"* * * * * * =================================="<<"\n";
         cout <<" * * * * *  =================================="<<"\n";
         cout <<"* * * * * * =================================="<<"\n";
         cout <<" * * * * *  =================================="<<"\n";
         cout <<"* * * * * * =================================="<<"\n";
         cout <<" * * * * *  =================================="<<"\n";
         cout <<"* * * * * * =================================="<<"\n";
         cout <<" * * * * *  =================================="<<"\n";
         cout <<"* * * * * * =================================="<<"\n";
         cout <<"=============================================="<<"\n";
         cout <<"=============================================="<<"\n";
         cout <<"=============================================="<<"\n";
         cout <<"=============================================="<<"\n";
         cout <<"=============================================="<<"\n";
         cout <<"=============================================="<<"\n";	

}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now