## Question: ## "number" is a word. ## If bit 0 is set then set bits 1, 2 ## and 3 and print out the result. ## If bit 0 is cleared then clear bits 1, 2 ## and 3 and print out the result. ## #/*# Output format must be: */ #/*# "result is = 1088" */Note that bits are numbered from right to left, the least significant bit is bit 0
There will be a
main program that calls a function named sentenceCase. It will be
passed a string (pointer to an array of characters). You will fix up
that string please. The main program will then print the result.
(Ignore the possibility of a proper name, like Frodo or Los Gatos)
& ANDSee example bitwise.c of using all these to change around case bits.
| Inclusive OR
^ Exclusive OR (XOR)
~ NOT (note use for AND mask, flipping all bits)
void sentenceCase(char* s) { /* body of function */ }Once it works for the test case, test it with mipsmark and submit with submit cs216.
mipsmark logic6.a
submit cs216 logic6.a
mipsmark changecase.c
submit cs216 changecase.c
mipsmark also includes the line
#include <stdio.h> at the top of the test file.
(Above the cut line).
If you have trouble with mipsmark, check the validity of your
calculations.
Then see common reasons mipsmark may
fail.
gcc changecase.cthere will be either syntax errors, or
./a.out