Answer:
A class is an instance of its object
Explanation:
Answer:
# The below code is in python programming language.
if(numberOfSides==4): #check the value number of slide is equal to 4 or not.
isQuadrilateral=True # assignment statement for if condition
else:
isQuadrilateral=False # assignment statement for else condition
Explanation:
The above code is in python language in which--
- The first lines are the "if" condition which checks the value of "numberofslides" variable.
- The second lines assign true in "isQuadrilateral" variable if "if" condition is true.
- The third line is for "else" statement that executes when the "if" condition is false.
- The fourth line is for "else" statement which assigns the value false to the numberofslides variables.
To be honest I feel like it’s B that’s looks and seems the most correct to me
Answer:
The program in C++ is as follows:
#include <iostream>
using namespace std;
void display(int array_test [], int n){
for(int i = 0; i<n;i++){
cout<<array_test[i]<<" "; }
}
int main(){
int n;
cin>>n;
int array_test[n];
for(int i = 0; i<n;i++){
cin>>array_test[i];
}
display(array_test,n);
return 0;
}
Explanation:
This defines the display function
void display(int array_test [], int n){
This iterates through the array
for(int i = 0; i<n;i++){
This prints each element of the array
cout<<array_test[i]<<" "; }
}
The main begins here
int main(){
This declares n as integer; n represents the length of the array
int n;
This gets input for n
cin>>n;
This declares the array
int array_test[n];
The following iteration gets input for the array
for(int i = 0; i<n;i++){
cin>>array_test[i];
}
This calls the display function to display the elements of the array
display(array_test,n);
return 0;
}