Answer :
The program should print the integers according to this formula is
nums[0][0]=a;
nums[0][1]=b;
nums[1][0]=c;
nums[1][1]=d;
nums[0][2]= nums[0][0] + nums[0][1]; //a+b
nums[1][2]= nums[1][0] + nums[1][1]; //c+d
nums[2][0] = nums[0][0] + nums[1][0]; //a+c
nums[2][1] = nums[0][1] + nums[1][1]; //b+d
//sum = (a+b) + (c+d) + (a+c) + (b+d)
nums[2][2] = nums[0][2] + nums[1][2] + nums[2][0] + nums[2][1];
The nums array is 2 dimensional as shown below.
row, column column 0 column 1 column 2
row 0 a b a+b
row 1 c d c+d
row 2 a+c b+d (a+b)+(c+d)+(a+c)+(b+d)
The first index of an array always starts from 0.
Thus, nums[rows][columns] is used to access each element of the array.
The sum of first row elements is to be stored in the last index of row0, that is in nums[1][2].
Thus we equate nums[0][2] = nums[0][0] + nums[0][1]
Similarly, for 2nd row; nums[1][2] = nums[1][0] + nums[1][1]
The sum of first column is to be stored in last index of column0.
Thus, nums[2][0] = nums[0][0] + nums[1][0]
and for 2nd column,
nums[2][1] = nums[0][1] + nums[1][1].
Thus, the answer is--
-------------------------------------------------------------------------------------------------------------------------------------
nums[0][0]=a;
nums[0][1]=b;
nums[1][0]=c;
nums[1][1]=d;
nums[0][2]= nums[0][0] + nums[0][1]; //a+b
nums[1][2]= nums[1][0] + nums[1][1]; //c+d
nums[2][0] = nums[0][0] + nums[1][0]; //a+c
nums[2][1] = nums[0][1] + nums[1][1]; //b+d
//sum = (a+b) + (c+d) + (a+c) + (b+d)
nums[2][2] = nums[0][2] + nums[1][2] + nums[2][0] + nums[2][1];
To learn more about program visit:https://brainly.com/question/11023419
#SPJ4