subject

Complete the commented parts in the code below:

#include
#include
#include

// Functions

//
// Function : main

// Inputs : argc - the number of command line parameters
// argv - the parameters
// Outputs : 0 if successful test, -1 if failure

// Function : ???
// ???

int main(int argc, char *argv[]) {

// Local variables
// NOTE: this is where you will want to add some new variables
int int_array1[10], int_array2[10];
unsigned int uint_array1[10];
int i;
//
if (argc < 11)
{
printf("Exiting the program, missing input");
return 0;
}
// Step a - read in the integer numbers to process
for (i=1; i<11; i++) {
int_array1[i-1] = atoi(argv[i]);//converting input to integer
}

// Step b - Convert numbers into positive values by taking their
// absolute values and save them in int_array2.

// Print all numbers in a single line using display_array function
//

// Step c - Convert these positive integers to numbers
// in the range 0,…,128 by implementing the mod operation
// save them back into int_array2.
// Print all numbers in a single line using display_array function
//

// Step d - for each integer in int_array2 print:
// number, number of 1 bits, even or odd
//

// Step e - Cast each element of int_array2 to unsigned short
// and store them into uint_array1.
//

// Step f - Reverse the order of array elements in uint_array1
// using swap_int function.

/*swap_ints(): function should swap the numbers without using
temp variable*/

// Step g - Update each element of uint_array1 by using reverseBits function.

/* reverseBit(): The function should return the number (in
integer format) whose bits are reversed,
i. e., the top bit of the original number is
the bottom bit of the returned number, the
second from the top bit of the original
number is the second to the bottom bit of
the returned number. */

// Step h - Print each element of uint_array1 in a separate line along with
// binary representation of each of the numbers using binaryString function.

/* binaryString():This function should fill the text string
with a binary representation of the number
suitable for printing. You should be using
some bitwise operations to achieve this,
maybe shifting(<<) and and (&)
operation

*/

// Return successfully
return(0);
}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 06:00
How can a user delete a drawing object
Answers: 1
question
Computers and Technology, 23.06.2019 14:00
Need ! will choose brainliest! discuss the role of abstraction in the history of computer software.
Answers: 1
question
Computers and Technology, 23.06.2019 15:00
Barbara is interested in pursuing a career in the science and math pathway. which qualifications will her reach that goal? a.an advanced knowledge of physics and math b.an advanced knowledge of engineering and math c. an advanced knowledge of physics and robotics an d. advanced knowledge of machinery and math
Answers: 2
question
Computers and Technology, 23.06.2019 16:30
Which of the following is not an enhancement to the standard wiki to make it more attractive for corporations? encryptionwork spacespermission toolspredictive text
Answers: 2
You know the right answer?
Complete the commented parts in the code below:

#include
#include
#include...
Questions
question
Biology, 04.05.2020 23:16
question
History, 04.05.2020 23:17