Answer:
int[ ][ ] X = new int[5][5];
It can also be declared and initialized this way:
int[][] X = {
{1,2,3,6,8},
{4, 5, 6, 9},
{7,5,6,8,9},
{8,5,8,8,9},
{10,2,6,8,11},
};
Explanation:
Above is a declaration of a two-dimensional array that can hold 5*5=25 int values. A java program is given below:
public class JavaTwoD{
public static void main(String args[ ]) {
// creating the 5X5 array
int[ ][ ] X = new int[5][5];
// looping through the array to add elements
for (int i = 0; i < X.length; i++) {
for (int j = 0; j < X[i].length; j++) {
X[i][j] = i * j;
}
}
Answer:
The prototype part missing has been assumed to be:
int reverseNum (int num);
Code:
#include <iostream>
using namespace std;
int reverseNum(int num);
int main()
{
int num=0,result=0;
cout<<"Enter the number:";
cin>>num;
result=reverseNum(num);
cout<<"The reversed number :"<<result<<endl;
return 0;
}
int reverseNum(int num)
{
int temp=0,digit=0;
for(num;num>0;num=num/10)
{
digit=num%10;
temp=temp*10+digit;
}
return temp;
}
Explanation:
Because it downsized the scale of the computer itself.
Answer:
The answer to the given question is "2 primary, 1 active, 1 extended, 3 logical".
Explanation:
In the given question we use this (2 primary, 1 active, 1 extended, 3 logical) partition on drive that can be explained as:
- In the drive, we use 2 primary partitions that name is active. This drive holds boot files for both the operating systems.
- After that, we will create 1 external partition.
- When we will create an external partition it will automatically create three logical drives and leave one additional primary drive for further storage automatically.
That's why we use this partition in this question.
Answer:
if(condition){
}
else {
// something we want to print
if(condition) {
// ...
}
else {
// ...
}
}
Explanation:
Create code blocks using curly braces { ... }.
Use proper indentation to visibly make it clear where code blocks start and end.