Display Hysteric Signs in C++ Program
I decided to give C++
programs on my website with their output and comments on each line. The
comments are used to show to text related to code in a program. Today the
program is being shared with you is about displaying hysteric sign on the
screen with some kind of format.
*****
****
***
**
*
*
**
***
****
*****
****
***
**
*
*
**
***
****
*****
*****
****
***
**
*
*
**
***
****
*****
****
***
**
*
*
**
***
****
*****
This Format we will show
you how to print in C++ program. So, let’s start the program:
1.
#include<iostream>// including header files in
program
2.
using
namespace std;
3.
void
main()//
main function
4.
{
5.
int a;// variable declaring
6.
for(a=0;a<=1;a++)// for loop
7.
{
8.
cout<<"*****\n****\n***\n**\n*\n";// statements
9.
cout<<"*\n**\n***\n****\n*****\n";
10.
}
11.
}
The text after the //
are basically the comments of the program that what the statement is performing.
I suggest you to bookmark this site because you will Tutorials, Presentations,
and many more you want.
Comments
Post a Comment