Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Stub Program for Problem 5 HW 2
// Stub program for Problem 5 HW 2 Fall 2016 #include <stdio.h> #define SIZE 30 #define ERROR -1 ////////////////////////////////////////////////////////////////////// // Function name: reverseBytes // // Description: Reverses the order of the bytes of an unsigned integer. // // Input parameters: // val, the unsigned int whose byte order is to be reversed. // // Returns: // The unsigned int whose value results from byte reversal. // unsigned int reverseBytes(unsigned int val) { // Your code goes here! } int main(void) { // number that we read in from stdin unsigned int inputNumber; // output result unsigned int outputNumber; printf("\n*** Stub program for Problem 5 -- reverseBytes ***\n\n"); // First read in an integer as hex scanf("%x\n", &inputNumber); // print out the input number printf("Read in the value %x.\n\n", inputNumber); // Call your routine outputNumber = reverseBytes(inputNumber); // Print out the result printf("After function call the returned value is %x.\n\n", outputNumber); return 0; }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
abc
Memory leak
project menu
Access the structure variable
Coba
Goodone for understanding array passing
18BCE2182 ASSESS_2 Q-1
multiplication
MatrixMul_shortxshort
sort_using_pointers.c
Please log in to post a comment.