Answer:
#include <iostream>
#include <cstdlib>
using namespace std;
int m, n;
void transpose(int matrix[]){
int transp[m][n];
for (int i = 0; i < n; i++){
for (int j = 0; j < m; j++){
transp[j][i] = matrix[i][j];
cout<< transp[j][i]<< " ";
}
cout<< "\n";
}
}
int main(){
cout<< "Enter the value for n: ";
cin>> n;
cout>> "Enter the value for m: ";
cin>> m;
int mymatrix[n][m];
for (int i = 0; i < n; i++){
for (int j = 0; j < m; j++){
mymatrix[i][j] = (rand() % 50);
}
}
transpose(mymatrix);
}
Explanation:
The C source code defined a void transpose function that accepts a matrix or a two-dimensional array and prints the transpose on the screen. The program gets user input for the row (n) and column (m) length of the arrays. The C standard library function rand() is used to assign random numbers to the array items.
Answer:
2.5 = float
'2.5' = str
3 = int
Explanation:
The data type: "float" is used for positive or negative decimals.
The data type: "str" is used for a sequence of letters, numbers, or symbols. Since the decimal used apostrophes, this means it's a character literal.
The data type: "int" is used for any positive or negative whole number.
Portrait landscape is better for wide images
Answer:
replace()
Explanation:
The history object in javascript corresponds to browsing history.
It has the following methods for navigating through the history list:
back(): Go back in the history list
forward(): Go forward in the history list
go() : Navigate to the currently pointed url in the history list. It takes a parameter which can either be a numeric index or a string which is matched with the history list content.
replace() is not a method in the history object.