Posted by MindBreaker at 9:40 PM
Read our previous post
Object
2-Using two dimensional
array multiple one matrix with scalar value.
Source code
#include <iostream>
using namespace std;
void
main()
{
int
num;
int
matrix[3][3]=
{
{3,0,8},
{2,4,2},
{1,3,5}
};
cout<<"Enter
a scaler value"<<endl;
cin>>num;
cout<<"Product
of matrix is "<<endl;
for(int a=0;a<3;a++)
{
{
for(int
b=0;b<3;b++)
cout<<matrix[a][b]*num<<" ";
}
cout<<endl;
}
}
Output
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.