C Plus Plus
Program to Display the Prism on Screen
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.
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