about-text

SoftOSet is the most remarkable programming site. SoftOSet provides the fresh conceptual and professional programs, articles, books, and other interesting and technical writings. SoftOSet is the most reliable programming site to learn the programs and the basics of the popular programming languages. SoftOSet is the hub of the informative and research based articles.

C Plus Plus Program to Display the Prism on Screen


Prism program of C plus plus

C++ program to display the prism of the screen. Yes, if you are looking for a program in C++ to print the prism on the screen, then you should be to stay here. We will develop a program in C++ to display the prism on the screen. So let’s start our work.

C++ Program to Display the Prism on Screen

Code

//softoset.blogspot.com

#include<iostream>

#include<conio.h>

using namespace std;

int main()

{

char WHITE=219;

char GRAY=176;

char ch;

for(int count=0;count<80*25-1;count++)

{

            ch=WHITE;

            for(int j=2;j<count;j++)

            {

                        if(count%j==0)

                        {

                                    ch=GRAY;

                                    break;

                        }

                        cout<<ch;

            }

}

getch();

return 0;

}

 

Output of Program to Display the Prism

 

And here is the output form this piece of code on the Dev C++ IDE.

 

Prism program of C plus plus

 

 

You can see that the prism is printed on the screen.

 

Thank you for visiting this site.

Keep visiting this site for the simple and soft programs of programming languages.


Post a Comment

Feel Free to Comment Us

Previous Post Next Post

Recents