Professional Documents
Culture Documents
1. Certificate
2. Acknowledgement
3. Preface
4. Introduction To Problem Area
5. Limitation of Manual System
6. Proposed System
7. System Design
a. Output
b. Input
c. File Design
8. Code
9. Output & Reports
9. Limitation of Project
10. Further Scope
11. References
ACKNOWLEDGEMENT
(Computer Application).
Project is like a bridge between
MANIPULATION ”.
PREFACE
In ever widening modern world, the present
system of education is facing new challenges.
It is well known fact that today is the age of
computers. There are so many major
achievements in science & technology fields.
Now a days every one is realizing the
importance of computer which is the
achievement of modern age in fifth generation
of computers.
2)Balagurusami Programming in C
1. OUTPUT
2. INPUT
3. FILE DESIGN
Output
matrices
matrices
matrices
matrices
5. Matrix Maximum- This module is used to find out the
order matrices
INPUT
N * M MATRIX
A B
1 2 3 4 5 6
4 5 6 7 8 9
7 8 9 1 2 3
File Design
Coding
/* MATRIX MANIPULATION PACKAGE */
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
int a[10][10],b[10][10],d[10][10];
int c,r,i,m,n,j,k,min,max,sum;
/* Blinking */
void blink()
{
int polyarray[]={100,100,550,100,550,400,100,400};
int gd=DETECT,gm;
initgraph(&gd,&gm," ");
setcolor(BROWN);
setlinestyle(0,0,3);
fillpoly(4,polyarray);
setcolor(RED);
settextstyle(10,0,2);
outtextxy(220,200,"MATRIX MANIPULATION");
while(!kbhit())
{
static int x;
setfillstyle(SOLID_FILL,x);
floodfill(320,240,BROWN);
setcolor(BLACK);
outtextxy(220,200,"MATRIX MANIPULATION");
delay(900);
setfillstyle(SOLID_FILL,x);
floodfill(320,240,BROWN);
setcolor(WHITE);
outtextxy(220,200,"MATRIX MANIPULATION");
delay(900);
}
getch();
closegraph();
}
/* Front Page of Project */
void front(){
int gd=DETECT,gm;
initgraph(&gd,&gm," ");
setfillstyle(SOLID_FILL,12);
bar(0,0,640,480);
setcolor(1);
setlinestyle(2,0,3);
line(30,120,620,120);
line(30,120,30,270);
line(30,270,620,270);
line(620,270,620,120);
setcolor(14);
settextstyle(TRIPLEX_FONT,HORIZ_DIR,7);
outtextxy(65,150,"MATRIX PACKAGE");
setfillstyle(SOLID_FILL,3);
bar(100,420,500,440);
settextstyle(SMALL_FONT,HORIZ_DIR,5);
setcolor(1);
outtextxy(150,423,"Welcome To Matrix Manipulation Project");
getch();
closegraph();}
/* Screen Designing */
void screen(const char *ch){
c=28;r=1;
gotoxy(c,r);
for(i=1;i<=25;i++){
printf("*");}
r++;
for(i=1;i<=2;i++){
gotoxy(c,r);
printf("*");
r++;}
r--;
c++;
gotoxy(c,r);
for(i=1;i<=24;i++){
printf("*");}
c=52;
r--;
for(i=1;i<=1;i++){
gotoxy(c,r);
printf("*");
r--;}
c=32;
r=2;
gotoxy(c,r);
printf("%s",ch);
c=16;
r=4;
gotoxy(c,r);
for(i=1;i<=44;i++){
printf("*");}
r=r+1;
for(i=1;i<=19;i++){
gotoxy(c,r);
printf("*");
r=r+1;}
c=c+1;
gotoxy(c,--r);
for(i=1;i<=43;i++){
printf("*");}
r=r-1;
c=59;
for(i=1;i<=18;i++){
gotoxy(c,r);
printf("*");}
/* Main Menu */
void menu(){
c=22;
r=6;
gotoxy(c,r);
printf("1.Addition");
gotoxy(c,r=r+2);
printf("2.Subtraction");
gotoxy(c,r=r+2);
printf("3.Multiplication");
gotoxy(c,r=r+2);
printf("4.Transpose");
gotoxy(c,r=r+2);
printf("5.Minimum");
gotoxy(c,r=r+2);
printf("6.Maximum");
gotoxy(c,r=r+2);
printf("7.Diagonal's Sum");
gotoxy(c,r=r+2);
printf("8.Exit");
}
/* Matrix Input */
void mat_input(){
printf("How Many Rows in The First Matrix ");
scanf("%d",&m);
printf("\n");
printf("How Many Columns in The First Matrix ");
scanf("%d",&n);
printf("\n");
printf("Enter the %d * %d Matrix Elements\n\n",m,n);
for(i=0;i<m;i++){
for(j=0;j<n;j++){
scanf("%d",&a[i][j]);}}
printf("\n");
printf("How Many Rows in The Second Matrix ");
scanf("%d",&m);
printf("\n");
printf("How Many Columns in The Second Matrix ");
scanf("%d",&n);
printf("\n");
printf("Enter the %d * %d Matrix Elements\n\n",m,n);
for(i=0;i<m;i++){
for(j=0;j<n;j++){
scanf("%d",&b[i][j]);}}}
/* Matrix Display */
void mat_display(){
clrscr();
printf("The First Matrix is:-\n\n");
for(i=0;i<m;i++){
for(j=0;j<n;j++){
printf("%d\t",a[i][j]);}
printf("\n");}
printf("\nThe Second Matrix is:-\n\n");
for(i=0;i<m;i++){
for(j=0;j<n;j++){
printf("%d\t",b[i][j]);}
printf("\n");}}
/* Matrix Addition */
void mat_add(){
printf("\nThe Matrix Addition is:-\n\n");
for(i=0;i<m;i++){
for(j=0;j<n;j++){
d[i][j]=a[i][j]+b[i][j];
printf("%d\t",d[i][j]);}
printf("\n");}}
/* Matrix Subtraction */
void mat_sub(){
printf("\nThe Matrix Subtraction is:-\n\n");
for(i=0;i<m;i++){
for(j=0;j<n;j++){
d[i][j]=a[i][j]-b[i][j];
printf("%d\t",d[i][j]);}
printf("\n");}}
/* Matrix Multiplication */
void mat_mul(){
for(i=0;i<m;i++){
for(j=0;j<n;j++){
d[i][j]=0;
for(k=0;k<n;k++){
d[i][j]=d[i][j]+a[i][k]*b[k][j];}}}
printf("\nThe Matrix Multiplication is:-\n\n");
for(i=0;i<m;i++){
for(j=0;j<n;j++){
printf("%d\t",d[i][j]);}
printf("\n");}}
/* Matrix Input */
void mat_input1(){
printf("How Many Rows in The Matrix ");
scanf("%d",&m);
printf("\n");
printf("How Many Columns in The Matrix ");
scanf("%d",&n);
printf("\n");
printf("Enter the %d * %d Matrix Elements\n\n",m,n);
for(i=0;i<m;i++){
for(j=0;j<n;j++){
scanf("%d",&a[i][j]);}}}
/* Matrix Display */
void mat_display1(){
clrscr();
printf("The Original Matrix is :-\n\n");
for(i=0;i<m;i++){
for(j=0;j<n;j++){
printf("%d\t",a[i][j]);}
printf("\n");}}
/* Matrix Transpose */
void mat_trans(){
printf("\nThe Matrix Transpose is :-\n\n");
for(i=0;i<m;i++){
for(j=0;j<n;j++){
printf("%d\t",a[j][i]);}
printf("\n");}}
/* Matrix Minimum */
void mat_minimum(){
min=a[0][0];
for(i=0;i<m;i++){
for(j=0;j<n;j++){
if(a[i][j]<min){
min=a[i][j];}}}
printf("\n");
printf("The Minimum Element in The Matrix is ->\t%d",min);}
/* Matrix Maximum */
void mat_maximum(){
max=a[0][0];
for(i=0;i<m;i++){
for(j=0;j<n;j++){
if(a[i][j]>max){
max=a[i][j];}}}
printf("\n");
printf("The Minimum Element in The Matrix is ->\t%d",max);}
/* Matrix Diagonal Sum */
void mat_diaognal(){
sum=0;
for(i=0;i<m;i++){
for(j=0;j<n;j++){
if(i==j){
sum=sum+a[i][j];}}}
printf("\n");
printf("The Sum Of Diaognal Element is ->\t%d",sum);}
/* Back Page */
void back()
{
int gd=DETECT,gm;
initgraph(&gd,&gm," ");
setfillstyle(SOLID_FILL,LIGHTGRAY);
bar(0,0,640,480);
setcolor(RED);
setlinestyle(0,0,3);
line(0,120,640,120);
settextstyle(TRIPLEX_FONT,HORIZ_DIR,6);
outtextxy(135,130,"Thanks@@@");
outtextxy(10,190,"For Using This Project!!!");
line(0,270,640,270);
settextstyle(TRIPLEX_FONT,HORIZ_DIR,3);
outtextxy(455,290,"DEVELOPED BY:-");
settextstyle(TRIPLEX_FONT,HORIZ_DIR,2);
outtextxy(455,320,"NAME:- SOURABH");
outtextxy(455,355,"CLASS:-B.COM II");
outtextxy(455,385,"ROLL NO:-");
setfillstyle(SOLID_FILL,BLUE);
bar(100,420,500,440);
settextstyle(SMALL_FONT,HORIZ_DIR,5);
outtextxy(150,423,"YOURS COMMENTS ARE ALWAYS
WELCOME");
getch();
closegraph();
}
/* Main Program Begins */
main(){
int ch;
char ans;
clrscr();
blink();
getch();
front();
abc:
clrscr();
screen("MATRIX PACKAGE");
menu();
gotoxy(c,r=r+2);
printf("\tEnter Your Choice ");
scanf("%d",&ch);
switch(ch){
case 1:
clrscr();
mat_input();
mat_display();
mat_add();
printf("\n\n\nPress Any Key to Return to Main Menu...");
getch();
goto abc;
break;
case 2:
clrscr();
mat_input();
mat_display();
mat_sub();
printf("\n\n\nPress Any Key to Return to Main Menu...");
getch();
goto abc;
break;
case 3:
clrscr();
mat_input();
mat_display();
mat_mul();
printf("\n\n\nPress Any Key to Return to Main Menu...");
getch();
goto abc;
break;
case 4:
clrscr();
mat_input1();
mat_display1();
mat_trans();
printf("\n\n\nPress Any Key to Return to Main Menu...");
getch();
goto abc;
break;
case 5:
clrscr();
mat_input1();
mat_display1();
mat_minimum();
printf("\n\n\nPress Any Key to Return to Main Menu...");
getch();
goto abc;
break;
case 6:
clrscr();
mat_input1();
mat_display1();
mat_maximum();
printf("\n\n\nPress Any Key to Return to Main Menu...");
getch();
goto abc;
break;
case 7:
clrscr();
mat_input1();
mat_display1();
mat_diaognal();
printf("\n\n\nPress Any Key to Return to Main Menu...");
getch();
goto abc;
break;
case 8:
clrscr();
gotoxy(10,5);
fflush(stdin);
printf("Really Do You Want To Exit (Y/N):-\t");
scanf("%c",&ans);
if(ans=='y' || ans=='Y'){
printf("\n\n\n");
printf("\t");
textcolor(10+128);
cprintf("Thanks For Using This Project!!!!");
getch();
exit(1);}
else
goto abc;
break;
default:
printf("Please Enter between 1 to 9 only");
back();
}
getch();}