Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Even or Odd
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include <iostream>
using namespace std;
int main()
{ int n;
cin>>n;
if(n%2==0)
{
cout<<n<<"is a even number<<endl;
}
else
{
cout<<n<<"is a odd number<<endl;
}
}
48 changes: 48 additions & 0 deletions Matrix_Multiplication
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#include <iostream>
using namespace std;
int main()
{
int A[10][10],B[10][10],mul[10][10],r,c,i,j,k;
cout<<"Enter the number of row=";
cin>>r;
cout<<"Enter the number of column=";
cin>>c;
cout<<"Enter the first matrix element=\n";
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
cin>>A[i][j];
}
}
cout<<"Enter the second matrix element=\n";
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
cin>>B[i][j];
}
}
cout<<"Multiply of the matrix=\n";
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
mul[i][j]=0;
for(k=0;k<c;k++)
{
mul[i][j]+=A[i][k]*B[k][j];
}
}
}
//for printing result
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
cout<<mul[i][j]<<" ";
}
cout<<"\n";
}
return 0;
}