answersLogoWhite

0


Best Answer

4.(Displaying matrix of 0s and 1s ) write a method that displays by n by n matrix using the following header : Public static void printMatrix(int n) Each element is o or 1,which is generated randomely. Write a test program that prints a 3 by 3 matrix that may look like this: 010 000 111 4.(Displaying matrix of 0s and 1s ) write a method that displays by n by n matrix using the following header : Public static void printMatrix(int n) Each element is o or 1,which is generated randomely. Write a test program that prints a 3 by 3 matrix that may look like this: 010 000 111

User Avatar

Wiki User

15y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

#include<stdio.h>

#include<conio.h>

void main()

{

int a[3][3],i,j;

clrscr();

printf("enter the elements\n");

for(i=0;i<3;i++)

{

for(j=0;j<3;j++)

{

scanf("%d",&a[i][j]);

}

}

printf("matrix\n");

for(i=0;i<3;i++)

{

for(j=0;j<3;j++)

{

printf("%d",a[i][j]);

}

printf("\n");

}

getch();

}

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

If this is a homework assignment, please consider trying it yourself first. Otherwise, you will lose the value of the reinforcement of the lesson that doing the homework provides.

int matrix[ROWS][COLUMNS];

int row, column;

for (row=0; rowfor (column=0; columnprintf("%d ", matrix[row][column]);
}
printf("\n");
}

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a test program that prints a 3 by 3 matrix?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Highlight the steps involve in writing a functional program?

Consult or think about the requirements; plan the general design; write your program; test it; correct and test (probably several times) until it works.In a larger project, you will probably do the above for each individual component at a time, i.e., you will be adding components gradually.Consult or think about the requirements; plan the general design; write your program; test it; correct and test (probably several times) until it works.In a larger project, you will probably do the above for each individual component at a time, i.e., you will be adding components gradually.Consult or think about the requirements; plan the general design; write your program; test it; correct and test (probably several times) until it works.In a larger project, you will probably do the above for each individual component at a time, i.e., you will be adding components gradually.Consult or think about the requirements; plan the general design; write your program; test it; correct and test (probably several times) until it works.In a larger project, you will probably do the above for each individual component at a time, i.e., you will be adding components gradually.


Write a program in c that prompt user with following lines add two integers test an integer for odd or even and quit?

write a program in C that prompts the user with the following lines: a) Add two integers c) Compare two integers for the larger t) Test an integers for odd or even q) Quit


What does the NOTS program have to do with?

The Nots Program has to do with.......this question is on traffic school test


Is there an answer book for the A plus program?

The A Plus Program is an initiative, not a test. So no, there is no answer book.


What are the steps in programming process?

Identify the ProblemProblem analysis and generate the RequirementsDesign the Program to the RequirementsDesign Test Cases to verify the RequirementsWrite the Program per the DesignCheck the Program against the Test Cases to show that the Requirements are satisfiedIntegrate the Program

Related questions

Determinant of test?

The determinant of test is usually a scalar quantity. The determinant of a matrix is used to test whether a given matrix has an inverse or not. It is used to test for the linear dependence of the vectors.


Does Matrix Essentials test on animals?

Yes. Matrix Essentials is part of L'oreal.


What has the author Tony Lancaster written?

Tony Lancaster has written: 'The covariance matrix of the information matrix test'


Write a C program to read the internal test marks of 25 students in a class and show the number of students who have scored more than 50 percent in the test. Make necessary assumptions?

Write a C program to read the internal test marks of 25 students in a class and show the number of students who have scored more than 50% in the test. Make necessary assumptions


Is it possible to write a complete program using only a decision structure?

No, you can use a decision structure to test a condition in any part of the program and execute some action based on the outcome but you cannot use a decision structure alone to write a complete program.


How do you write-design an audit test that will form part of an audit program for a certain control for stolen material?

with a pencil?


How do you add a book to the Accelerated Reader program?

A teacher can add a test to the AR program if allowed by the school district. You need a word count and reading level. Then you write a 10 or 20 question test with about 1 question per chapter. You write the correct answer first and then the distracting answers. When students take the test, the software randomizes the placement of the correct answer.


When can you not invert a matrix?

If it is not a square matrix. You cannot invert a square matrix if it is singular. That means that at least one of the rows of the matrix can be expressed as a linear combination of the other rows. A simple test is that a matrix cannot be inverted if its determinant is zero.


Is a surgical technologist test hard?

A surgical technologist test is not hard if one has already followed an accredited program. By obtaining a diploma first, you can be assured you have all the appropriate knowledge to write the test.


Write a shell program using if-the-else to test whether a variable name is a directory or a file?

see : Write_a_shell_program_using_the_if-the-else_to_test_whether_a_variable_name_is_a_directory_or_a_file


What is a set of tools called that is used to write test edit and debug a computer program?

An integrated development environment (IDE).


Highlight the steps involve in writing a functional program?

Consult or think about the requirements; plan the general design; write your program; test it; correct and test (probably several times) until it works.In a larger project, you will probably do the above for each individual component at a time, i.e., you will be adding components gradually.Consult or think about the requirements; plan the general design; write your program; test it; correct and test (probably several times) until it works.In a larger project, you will probably do the above for each individual component at a time, i.e., you will be adding components gradually.Consult or think about the requirements; plan the general design; write your program; test it; correct and test (probably several times) until it works.In a larger project, you will probably do the above for each individual component at a time, i.e., you will be adding components gradually.Consult or think about the requirements; plan the general design; write your program; test it; correct and test (probably several times) until it works.In a larger project, you will probably do the above for each individual component at a time, i.e., you will be adding components gradually.