Access over 35 million academic & study documents

8D (C Programming) How many dimensions does it array nums[] below ha

Content type
User Generated
Showing Page:
1/2
8D (C Programming) How many dimensions does it array
nums[] below have? How many elements in each
dimension? What are the elements at each dimension? int
nums[2][3] = {{2, 4, 6}, {-9, -7, -5}}; Given an unsorted,
single-dimensional int array num[] of 5000 elements, write
a short C program using a doubly nested loop that sorts
the array in decreasing order.
Solution
19)
nums[2][3], has 2 dimensions, hence it is 2-d array with 2
rows and 3 coloumns,
elements on rows : 2 4 6 , -9 -7 -5
elements on coloumns : 2 -9 , 4 -7 , 6 -5
20)
#include <stdio.h>
#define SIZE 5000
int main()
{
int num[SIZE]; // input array here
int i=0,j=0;
for(i=0;i<SIZE;i++){
for(j=i;j<SIZE;j++){

Sign up to view the full document!

lock_open Sign Up
Showing Page:
2/2

Sign up to view the full document!

lock_open Sign Up
Unformatted Attachment Preview
8D (C Programming) How many dimensions does it array nums[] below have? How many elements in each dimension? What are the elements at each dimension? int nums[2][3] = {{2, 4, 6}, {-9, -7, -5}}; Given an unsorted, single-dimensional int array num[] of 5000 elements, write a short C program using a doubly nested loop that sorts the array in decreasing order. Solution 19) nums[2][3], has 2 dimensions, hence it is 2 -d array with 2 rows and 3 coloumns, elements on rows : 2 4 6 , -9 -7 -5 elements on coloumns : 2 -9 , 4 -7 , 6 -5 20) #include #define SIZE 5000 int main() { int num[SIZE] ...
Purchase document to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.
Studypool
4.7
Indeed
4.5
Sitejabber
4.4

Similar Documents