Answer:
#include <iostream>
using namespace std;
int main() {
int a[4][5];//declaring a matrix of 4 rows and 5 columns.
for(int i=0;i<4;i++)
{
for(int j=0;j<5;j++)
{
if(i==3)//initializing last row as 0.
{
a[i][j]=0;
}
else//initializing last row as 1.
{
a[i][j]=1;
}
}
}
for(int i=0;i<4;i++)
{
for(int j=0;j<5;j++)
cout<<a[i][j]<<" ";//printing the matrix.
cout<<endl;
}
return 0;
}
Output:-
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
0 0 0 0 0
Explanation:
I have created a matrix of size 4 rows and 5 columns.I have used for loops to fill the array.To fill the last row with 0 i have used if statement.else we are filling it with 1.
Answer:
I will try to help you answer this. it seems really confusing but I'll do my best to solve it and get it back to you. Hope I'm able to help!
Answer:
The expression on line 9 required 2 brackets
Explanation:
Given
The attached code
Required
Why syntax error.
The error points to line 10, but the error is actually from line 9
To get an integer input, the syntax is:
variable-name = int(input("Prompt"))
From the attached code, the line 9 is:
amount = int(input("Enter cheese order weight: ")
By comparing the syntax to the actual code on line 9, only 1 of the brackets is closed.
<em>This, in Python 3 is a sytax error</em>
Answer:
general regulatory and speed control.
Your correct answer would be Legend.
answer choice is B.