Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Declare a 2-dimensional array with three 1D arrays, each containing 2 elements.

ID: 3687822 • Letter: D

Question

Declare a 2-dimensional array with three 1D arrays, each containing 2 elements. Assign values to all of the array elements in any syntactically correct manner. Explain a method of swapping the value of two variables with an example. Use isblank() appropriately in an if-else statement. The last index of an array of size 10 Is 11 double a[5] ={}; assigns value 5 to all elements char a[] = {'a','b','c','d'}; assigns a NULL character at the end automatically Swapping values of two variables using multiplication/division is problematic if one of the values is 0

Explanation / Answer

5. False

6. False

7. True

8. True

9.
int arr[][]={{1,2},{3,4},{5,6}};
10.
void swap(int *num1,int *num2){
   int temp=*num1;
   *num1=*num2;
   *num2=temp;
}
this funtion has void as return type.
argument of functions are pointer integer type. which will have address of num1 and num2. and it will copy the value of num1 in temp. than copy the value of num2 in num1. after that copy the value of temp in num2.

11.
if (isblank(c))
{
   c=' ';
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote