create a c++ program that will accepts 9 inputs using 3 by 3
array.

Answer Posted / s.verma

#include<iostream>
#include<conio.h>

using namespace std;

int main()
{
int matrix[3][3];

cout<<"Enter a 3x3 matrix row-wise :: \n"

for(int i=0; i<3; i++)
{
for(int j=0; j<3; j++)
cin>>matrix[i][j];
}

cout<<"\nYou eneterd :: \n"

for(int i=0; i<3; i++)
{
for(int j=0; j<3; j++)
{
cout<<matrix[i][j]<<" ";
}
cout<<"\n";
}

getch();
return 0;
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are oops methods?

562


What is an example of genetic polymorphism?

645


Why do we use class in oops?

551


What is interface in oop?

656


What is overloading in oop?

572






What is abstraction in oop with example?

642


What causes polymorphism?

566


Write a java applet that computes and displays the squares of values between 25 and 1 inclusive and displays them in a TextArea box

2027


INSTANCE FIELDS DECLARED private ARE ACCESSIBLE BY THE METHODS ONLY.CAN WE CHANGE THE private FIELD OF AN OBJECT IN A METHOD OF SOME OTHER OBJECT OF THE SAME CLASS?

1630


IS IT NECESSARY TO INITIALIZE VARIABLE? WHAT IF THE INSTANCE VARIABLE IS DECLARED final ? IS IT NECESSARY TO INITIALIZE THE final VARIABLE AT THE TIME OF THEIR DECLARATION?

1574


what are the ways in which a constructors can be called?

1574


Write a program to implement OOPS concepts such as inheritance, polymorphism, friend function, operator overloading?

4234


What is overloading and its types?

610


Is enum a class?

602


Can destructor be overloaded?

593