Get Assistance Following Requirements Modify Program Figure 210 Limit Num Review Book Sec Q43862467
Can I get assistance with the following. Here are therequirements
Modify the program Figure 2.10 (limit/num). Review the book section on the switch statement and the ‘else if’ clauseAdd new ‘const’ variables: base2, base3, base8, base10 and base16. Assign them the value the name impliesAsk the user to enter a number base (2, 3, 8, 10 or 16)Follow the table below to output the correct value: base output—– —— 2 Binary 0..1 3 Trinary 0..2 8 Octal 0..7 10 Decimal 0..9 16 Hexidecimal 0..FIn other words, the program used to do this:99lowNow it should do this 8Octal 0..7If you run it again:2Binary 0..1If you run it again:16Hexidecimal 0..FUse ‘else if’ statements AND the ‘const’ variables to test the input.Use an ‘else’ at the very end and print an error messge when the input is NOT 2,3,8,10 or 16
Here is my code.
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char** argv) {
const int limit = 100;
int num;
scanf(“%d”, &num);
if(num >= limit){
printf(“highn”);
}
else{
printf(“lown”);
}
return (0);
}
Thank you
Expert Answer
Answer to Can I get assistance with the following. Here are the requirements Modify the program Figure 2.10 (limit/num). Review t…
OR