Question: 2. ( 20 points) Here are four C programs to tratushate binary to decimal; that is, you rua / plo 101 and it will
2. ( 20 points) Here are four C programs to tratushate binary to decimal; that is, you rua " / plo 101 and it will print ' 5 '. For each program, indicate whether it works. If if does not, shour hoar to fix it hy changing the fewest characters possible. Note that these programs will crab if not given an argument; that's not considered an error per the design spec. Program A Works as is: Needs fixing. "include stdio, h> \#include \#include int main (int argc, char *argv[) i int val=0; // warning: assumes argv[1]! int len =strlen(argv[1]); for (int 1=0;1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
