Let multidimensional array a with size 3x4 be {1,2,3,4,5,6,7,8,9,10,11,12} and b be the last digit of your student number. Accordingly, if we run the given functions in the following order, what will be the output? Explain step by step. b= 5 function1(b); print(A,b); function2(A,b); print(A,b); function3(A[b%4][b%3],b); print(A,b);

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section5.5: A Closer Look: Loop Programming Techniques
Problem 12E: (Program) Write a program that tests the effectiveness of the rand() library function. Start by...
icon
Related questions
Question
2) Let
multidimensional
array
with
size
3 x 4
be
a
{1,2,3,4,5,6,7,8,9,10,11,12} and b be the last digit of your student
number. Accordingly, if we run the given functions in the following order,
what will be the output? Explain step by step.
b= 5
function1(b);
print(A,b);
function2(A,b);
print(A, b);
function3(A[b%4][b%3],b);
print(A,b);
void print(int a(][3],int b){
printf("\nb=%d",b);
for(int i=0;i<4;i++}{
printf("\n");
for(int j=0;j<3;j++}{
printf("%3d",a[i][]);
}
void function1(int a)}{
a=a+2;
void function2(int A[][3],int b){
for(int j=0;j<3;j++){
A[2]]=A[2][i]+b;
}
void function3(int a,int b){
a=a+b;
Transcribed Image Text:2) Let multidimensional array with size 3 x 4 be a {1,2,3,4,5,6,7,8,9,10,11,12} and b be the last digit of your student number. Accordingly, if we run the given functions in the following order, what will be the output? Explain step by step. b= 5 function1(b); print(A,b); function2(A,b); print(A, b); function3(A[b%4][b%3],b); print(A,b); void print(int a(][3],int b){ printf("\nb=%d",b); for(int i=0;i<4;i++}{ printf("\n"); for(int j=0;j<3;j++}{ printf("%3d",a[i][]); } void function1(int a)}{ a=a+2; void function2(int A[][3],int b){ for(int j=0;j<3;j++){ A[2]]=A[2][i]+b; } void function3(int a,int b){ a=a+b;
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Arrays
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning