Question: consider the given code and do the following: 1: int arr[10] = (-5, 10, -7,0); 2: int size= sizeof(arr) / sizeof(arr[0]); 3: printf(Original array:

consider the given code and do the following: 1: int arr[10] =(-5, 10, -7,0); 2: int size = sizeof(arr) /

consider the given code and do the following: 1: int arr[10] = (-5, 10, -7,0); 2: int size= sizeof(arr) / sizeof(arr[0]); 3: printf("Original array: "); 4: for (int i= 0; i < size; i++) { 5: printf("%d", arr[i]); 6: } 7: printf(" "); 8: for (int i = 0; i < size; i++) { 9: if (arr[i] < 0) arr[i] = -arr[i]; 10: 11: } 12: printf("Absolute value array: "); 13: for (int i=0; i < size; i++) { 14: printf("%d", arr[i]); 15: } 16: printf(" "); Q1: Draw the Control Flowgraph of the following code. Q2: Demonstrates P1 and P2 coverage testing.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

v 3 printfOriginal array 4 for int i 0 i size i 5 printfd arri v 7 printf v 8 for int i 0 i size i 9 ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!