Write a program that will input two arrays of information


Program 1: C program that will first read a positive number (i.e x) from standard input. then create enough space in the heap via a call to malloc to hold an array of x integers. you then need to use array index operators to fill the array with x integer values entered by the user via calls to scanf. after the array has been filled with numbers, your program should walk down the array adn built the sum and print out the sum.

Program 2: C program that will read 12 integers values into a 3x4 two dimensional array(an array of 3 of 4 integers). the values should be entered via standard input. the main program should call a function sum that will calculate the sum of the values and return this sum back to the main program. the main program will output the sum.

Program 3: C program that will malloc up space dynamically. the space should be able to hold exactly one integer value. after the space has been reserved, you should deposit the number 6 into the space and print the value that the space currently holds 6.  you need to create a variable that contains a pointer to an int. do not use an array index operator. once you are done, you should free the allocated space explicitly.

Program 4: Write a program that will input two arrays of information. Each array will contain exactly 4 floating point values. Your program will enter these values from standard input. Once the values have been read in, your program should call a function that will compute the inner product of these two arrays. The function should return the value back to the main program. The main program will then print out the value. You should not print the value out inside the inner product function. The inner product of two arrays is a single number obtained by multiplying corresponding elements and then adding up their sums.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Write a program that will input two arrays of information
Reference No:- TGS01678053

Now Priced at $20 (50% Discount)

Recommended (91%)

Rated (4.3/5)