Question: Part 4 Correct errors in program. (11 points in total): 1) (5 points) The following program is used to check if a given number is

 Part 4 Correct errors in program. (11 points in total): 1)

Part 4 Correct errors in program. (11 points in total): 1) (5 points) The following program is used to check if a given number is the power of 2 using bitwise operator 1 include 2 define NUM BITS INT (8 sizeof (double)) 4 nt power2 (unsigned int x) int i, count - 0, result, shiftnum; - for (i - 0;i i result-shift num &&1i if (result) 12 13 14 15 16 17 18 19 20 21 22 int main) 23 24 25 26 27 28 29 30 count++ if (count % 2-1) printf ("YES") else print("NO") unsigned int num; printf("InEnter Number"); scanf("%d", num); this.power2 (num) return 0; Which line(s) is(are) incorrect And how to correct it(them)? Please write down your correction for that line (those lines) 2) (6 points) The following shell script is used to check if the numbers from command line are even or odd bin/bash count 4 for Snum in s@ 5 do if [ expr $num % 2 -- ] then echo Snum is an even number count expr $count+i 10 else echo Snum is an odd number 12 13 14 15 echo There are $count even numbers in total Ei Which line(s) is(are) incorrect? And how to correct it(them)? Please write down your correction for that line (those lines)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!