Lecture 80
//Print diagonal line in the screen
#include <iostream>
#include <conio.h>
using namespace std;
main ()
{
int x,y;
for(y=1;y<24;y++)
{
for(x=1;x<24;x++)
if(x==y)
cout<<"\xDB";
else
if(x==2*y)
cout<<"\xB1";
else
cout<<" ";
cout<<endl;
}
getch();
return 0;
}
Code view in dev compiler:
Compile the program Ctrl+F9
Run program Ctrl+F10