Computers and Technology

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);
}

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 08:30, marialuizavalen
Today is the anniversary of me being on yet, i don't need it anymore! here's a picture of my dog wearing a bowtie! my question is, how do i delete my account?
Answers: 1
image
Computers and Technology, 22.06.2019 19:10, hgdthbgjnb83661
What a backup plan that you have created in a event you encounter a situation
Answers: 2
image
Computers and Technology, 22.06.2019 22:30, reinasuarez964
One of your customers wants you to build a personal server that he can use in his home. one of his concerns is making sure he has at least one backup of their data stored on the server in the event that a disk fails. you have decided to back up his data using raid. since this server is for personal use only, the customer wants to keep costs down. therefore, he would like to keep the number of drives to a minimum. which of the following raid systems would best meet the customer's specifications? a. raid 0 b. raid 1 c. raid 5 d. raid 10
Answers: 3
image
Computers and Technology, 24.06.2019 15:50, coralaguilar1702
Andy would like to create a bulleted list. how should he do this? andy should click on the bullet icon or select the bullet option from the menu and then type the list. andy should press the shift key and the 8 key at the beginning of each line of text. andy should type the text and then click on the bullet command. andy should press return and the bullets will automatically
Answers: 2
Do you know the correct answer?
Complete the commented parts in the code below:

#include
#include
#include...

Questions in other subjects:

Konu
Business, 18.10.2020 09:01
Konu
Mathematics, 18.10.2020 09:01
Konu
Mathematics, 18.10.2020 09:01
Konu
Mathematics, 18.10.2020 09:01
Konu
Mathematics, 18.10.2020 09:01
Konu
Mathematics, 18.10.2020 09:01