===========================================================================
CODING
#include<iostream.h>
#include<conio.h>
#include<math.h>
#include<stdio.h>
#include<process.h>
#include<dos.h>
void main()
{
clrscr();
int b[80],k,j,X,i,n,r,x,y,m,a[80][80],ch,l,o[10],q;
textcolor(WHITE);
cprintf("Enter No. of Obs.: ");
cscanf("%d",&k);
for(i=0,x=3,y=3;i<=k-1;i++,x+=5)
{
textcolor(WHITE);
if(i==0)
{
gotoxy(x,y);
cprintf("ÕÍÍÍÍ");
gotoxy(x,y+1);
cprintf("³ ");
gotoxy(x,y+2);
cprintf("ÔÍÍÍÍ");
}
else if(i==k-1)
{
gotoxy(x,y);
cprintf("ÑÍÍÍ͸");
gotoxy(x,y+1);
cprintf("³ ³");
gotoxy(x,y+2);
cprintf("ÏÍÍÍ;");
}
else
{
gotoxy(x,y);
cprintf("ÑÍÍÍÍ");
gotoxy(x,y+1);
cprintf("³ ");
gotoxy(x,y+2);
cprintf("ÏÍÍÍÍ");
}
}
for(i=0,x=5;i<k;i++,x+=5)
{
gotoxy(x,4);
cscanf("%d",&b[i]);
}
for(j=0,x=5;j<=k-1;j++)
{
for(i=0;i<=k-2-j;i++)
{
textcolor(5);
gotoxy(x+5*(i),4);
cprintf("%.2d",b[i]);
textcolor(YELLOW);
gotoxy(x+5*(i+1),4);
cprintf("%.2d",b[i+1]);
if(b[i]>b[i+1])
{
r=b[i];
b[i]=b[i+1];
b[i+1]=r;
}
sound(300);
delay(1500);
nosound();
textcolor(WHITE);
gotoxy(x+5*(i),4);
cprintf("%.2d",b[i]);
gotoxy(5*(i+1)+x,4);
cprintf("%.2d",b[i+1]);
}
}
gotoxy(1,7);
cprintf("ALL POSSIBLE COMBINATIONS: ");
gotoxy(1,8);
cprintf("ÕÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍ͸");
gotoxy(1,9);
cprintf("³ Rows ³ Coloumn ³");
gotoxy(1,10);
cprintf("ÆÍÍÍÍÍÍÍØÍÍÍÍÍÍÍÍÍ͵");
for(i=1,l=1;i<=k;i++)
{
for(j=1;j<=k;j++)
{
if(i*j==k)
{
o[l]=i;
l++;
gotoxy(1,9+l);
cprintf("³ %d ³ %d ³",i,j);
}
}
}
gotoxy(1,10+l);
cprintf("ÆÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍ͵");
gotoxy(1,11+l);
cprintf("³ Option: ³");
gotoxy(1,12+l);
cprintf("ÔÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ;");
gotoxy(15,11+l);
cscanf("%d",&l);
m=o[l];
n=k/m;
gotoxy(1,10+l);
textbackground(YELLOW);
cprintf("³ %d ³ %d ³",m,n);
textbackground(BLACK);
for(i=0,k=0;i<m;i++)
{
for(j=0;j<n;j++,k++)
{
a[i][j]=b[k];
}
}
sound(500);
delay(300);
nosound();
for(i=0,y=10;i<m;i++,y+=2)
{
for(j=0,x=45;j<n;j++,x+=5)
{
gotoxy(x,y);
if(i==0 && j==0)
cprintf("ÕÍÍÍÍ");
else if(i==0 && j==n-1)
cprintf("ÑÍÍÍ͸");
else if(i==0)
cprintf("ÑÍÍÍÍ");
gotoxy(x,y+1);
if(j==n-1)
cprintf("³ ³");
else
cprintf("³ ");
gotoxy(x,y+2);
if(i==m-1 && j==0)
cprintf("ÔÍÍÍÍ");
else if(i==m-1 && j==n-1)
cprintf("ÏÍÍÍ;");
else if(i==m-1)
cprintf("ÏÍÍÍÍ");
else if(j==0)
cprintf("ÆÍÍÍÍ");
else if(j==n-1)
cprintf("ØÍÍÍ͵");
else
cprintf("ØÍÍÍÍ");
}
}
textcolor(BLUE);
textcolor(CYAN);
gotoxy(34,11);
cprintf(" þ ");
gotoxy(34,12);
cprintf(" þþþ ");
gotoxy(34,13);
cprintf("þþþþþþþþþ ");
gotoxy(34,14);
cprintf(" þþþ ");
gotoxy(34,15);
cprintf(" þ ");
for(i=0,k=0,y=11,q=0,X=5;i<m;i++,y+=2)
{
for(j=0,x=47;j<n;j++,x+=5,k++,X+=5,q++)
{
textcolor(YELLOW);
gotoxy(X,4);
cprintf("%.2d",b[q]);
gotoxy(x,y);
textcolor(YELLOW);
cprintf("%d",a[i][j]);
delay(1000);
textcolor(WHITE);
gotoxy(X,4);
cprintf("%.2d",b[q]);
gotoxy(x,y);
textcolor(WHITE);
cprintf("%d",a[i][j]);
}
}
getch();
getch();
}
CODING
#include<iostream.h>
#include<conio.h>
#include<math.h>
#include<stdio.h>
#include<process.h>
#include<dos.h>
void main()
{
clrscr();
int b[80],k,j,X,i,n,r,x,y,m,a[80][80],ch,l,o[10],q;
textcolor(WHITE);
cprintf("Enter No. of Obs.: ");
cscanf("%d",&k);
for(i=0,x=3,y=3;i<=k-1;i++,x+=5)
{
textcolor(WHITE);
if(i==0)
{
gotoxy(x,y);
cprintf("ÕÍÍÍÍ");
gotoxy(x,y+1);
cprintf("³ ");
gotoxy(x,y+2);
cprintf("ÔÍÍÍÍ");
}
else if(i==k-1)
{
gotoxy(x,y);
cprintf("ÑÍÍÍ͸");
gotoxy(x,y+1);
cprintf("³ ³");
gotoxy(x,y+2);
cprintf("ÏÍÍÍ;");
}
else
{
gotoxy(x,y);
cprintf("ÑÍÍÍÍ");
gotoxy(x,y+1);
cprintf("³ ");
gotoxy(x,y+2);
cprintf("ÏÍÍÍÍ");
}
}
for(i=0,x=5;i<k;i++,x+=5)
{
gotoxy(x,4);
cscanf("%d",&b[i]);
}
for(j=0,x=5;j<=k-1;j++)
{
for(i=0;i<=k-2-j;i++)
{
textcolor(5);
gotoxy(x+5*(i),4);
cprintf("%.2d",b[i]);
textcolor(YELLOW);
gotoxy(x+5*(i+1),4);
cprintf("%.2d",b[i+1]);
if(b[i]>b[i+1])
{
r=b[i];
b[i]=b[i+1];
b[i+1]=r;
}
sound(300);
delay(1500);
nosound();
textcolor(WHITE);
gotoxy(x+5*(i),4);
cprintf("%.2d",b[i]);
gotoxy(5*(i+1)+x,4);
cprintf("%.2d",b[i+1]);
}
}
gotoxy(1,7);
cprintf("ALL POSSIBLE COMBINATIONS: ");
gotoxy(1,8);
cprintf("ÕÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍ͸");
gotoxy(1,9);
cprintf("³ Rows ³ Coloumn ³");
gotoxy(1,10);
cprintf("ÆÍÍÍÍÍÍÍØÍÍÍÍÍÍÍÍÍ͵");
for(i=1,l=1;i<=k;i++)
{
for(j=1;j<=k;j++)
{
if(i*j==k)
{
o[l]=i;
l++;
gotoxy(1,9+l);
cprintf("³ %d ³ %d ³",i,j);
}
}
}
gotoxy(1,10+l);
cprintf("ÆÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍ͵");
gotoxy(1,11+l);
cprintf("³ Option: ³");
gotoxy(1,12+l);
cprintf("ÔÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ;");
gotoxy(15,11+l);
cscanf("%d",&l);
m=o[l];
n=k/m;
gotoxy(1,10+l);
textbackground(YELLOW);
cprintf("³ %d ³ %d ³",m,n);
textbackground(BLACK);
for(i=0,k=0;i<m;i++)
{
for(j=0;j<n;j++,k++)
{
a[i][j]=b[k];
}
}
sound(500);
delay(300);
nosound();
for(i=0,y=10;i<m;i++,y+=2)
{
for(j=0,x=45;j<n;j++,x+=5)
{
gotoxy(x,y);
if(i==0 && j==0)
cprintf("ÕÍÍÍÍ");
else if(i==0 && j==n-1)
cprintf("ÑÍÍÍ͸");
else if(i==0)
cprintf("ÑÍÍÍÍ");
gotoxy(x,y+1);
if(j==n-1)
cprintf("³ ³");
else
cprintf("³ ");
gotoxy(x,y+2);
if(i==m-1 && j==0)
cprintf("ÔÍÍÍÍ");
else if(i==m-1 && j==n-1)
cprintf("ÏÍÍÍ;");
else if(i==m-1)
cprintf("ÏÍÍÍÍ");
else if(j==0)
cprintf("ÆÍÍÍÍ");
else if(j==n-1)
cprintf("ØÍÍÍ͵");
else
cprintf("ØÍÍÍÍ");
}
}
textcolor(BLUE);
textcolor(CYAN);
gotoxy(34,11);
cprintf(" þ ");
gotoxy(34,12);
cprintf(" þþþ ");
gotoxy(34,13);
cprintf("þþþþþþþþþ ");
gotoxy(34,14);
cprintf(" þþþ ");
gotoxy(34,15);
cprintf(" þ ");
for(i=0,k=0,y=11,q=0,X=5;i<m;i++,y+=2)
{
for(j=0,x=47;j<n;j++,x+=5,k++,X+=5,q++)
{
textcolor(YELLOW);
gotoxy(X,4);
cprintf("%.2d",b[q]);
gotoxy(x,y);
textcolor(YELLOW);
cprintf("%d",a[i][j]);
delay(1000);
textcolor(WHITE);
gotoxy(X,4);
cprintf("%.2d",b[q]);
gotoxy(x,y);
textcolor(WHITE);
cprintf("%d",a[i][j]);
}
}
getch();
getch();
}
===========================================================================
No comments:
Post a Comment