Answer:
Option 4: Value-returning
Explanation:
In programming, a method is a named section of codes that perform a specific task. This is possible to define a method that return a value after performing its task. This type of method is known as Value-returning method.
For example, we can define a method addition that takes two inputs, x, y and return the summation of x + y to the code that called it. The codes are as follows:
- public static void main(String[] args) {
- int sum = addition(3, 5);
- }
-
- public static int addition(int x, int y){
- return x + y;
- }
Answer: Virtual desktop infrastructure
Explanation:
The virtual desktop infrastructure is the virtualization technology in which the host desktop OS (operating system) is in the centralized server of the data center. The virtual desktop infrastructure is also known as server based computing as it include the variation in the computing model such as client - server model.
The example of the virtual desktop infrastructure is wallpapers, toolbars, window and folder is the stored in the server remotely.
All the other options does not involve with this technology so that is why option (D) is correct.
Answer:
The program to this question as follows:
Program:
//header file iostream
#include<iostream> //including file for use basic function
//using name space
using namespace std;
//main method
int main() //defining main method
{
int a[3][3]; //defining two dimension array
int x,y,sum=0; //defining variables
cout<<"Enter array elements: "<<endl; //message
for(x=0;x<3;x++) // for row
{
for(y=0;y<3;y++) //for column
{
cin>>a[x][y]; //input values from user.
}
}
//loop for calculting sum.
for(x=0;x<3;x++)
{
for(y=0;y<3;y++)
{
sum=sum+a[x][y];//add all elements
}
}
cout<<"Sum: "<<sum; //print sum.
return 0;
}
Output:
Enter array elements:
1
2
3
4
5
6
7
8
9
Sum: 45
Explanation:
In the above C++ programming language code first, a header file is included then the main method is declared, inside a main method 2D array that is "a[][]", and an integer variable is defined that are "i, j, and sum". In the next line for loop is used, this loop is used two times that can be described as follows:
- The first time it is used for inserting elements from user ends.
- The second time, it uses the sum variable to add all array elements. and in the last print function that is "cout" is used for print sum variable value.