Question: a ) Rewrite the following code after correcting the errors. #include #include int Main ( ) { Float n _ , m = 5 ;

a) Rewrite the following code after correcting the errors. #include #include int Main (){ Float n_, m =5; scanf("%d", n_) float p =(n_%m)/sqrt(6; printf("%d", P); }[2] b) Identify the invalid variable names from the following. Mention the reasons that make them invalid. _Num1,1time, $VALUE, myValue, num6, first_name, last-name, f1x [2] c) Compute the values of the variables a, b, c, and d. int a =10.0/3*10; float b =(int)23.0%11; int c =(10>9 && 21<=19)*5; float d =7/2; [2]2 a) Find the outputs when the input values of variable b are 4,5,10 and 12, respectively. int b; scanf(%d, &b); printf(Begin
); if (b>=5) printf(UIU
); else if(b<=5) printf(CSE
); else if ((b>=2)||(b<10)) printf(COMPUTER
); else if ((b>2)&&(b<=10)) printf(NICE
); else printf(Bye
); printf(End); [2] b) In a factory there are three categories of employees: X, Y, Z. The manager announced a bonus for the employees who have 12 years or more work experience and more than 5 family members, OR Less than 1000.50 BDT total family income per month He is also generous to his bonus deprived employees who have a larger family. Thus, He has declared the bonus for For the employees of Y and Z categories who have more than 8 family members and has less than 1100.78 BDT total family income per month. However, if an employee is from X category, he can avail the bonus having more than 6 family members. Now you need to automate the system by writing a program to take following inputs from user (employee) and notify him whether he is eligible for the bonus or not. Category (character) Years of work experience (integer) Number of family members (integer) Total family income per month (float)[4] United International University (UIU) Dept. of Computer Science & Engineering (CSE) Page 2 of 23 a) Manually trace (show the values of all the variables in each step) the following code segment. int n =5, sum =0, i, a =3, sign =1; for(i =1; i<=n; i++){ sum = sum + a*sign; if(i%2==0) a = a +6; else a = a +4; sign =-sign; } printf("
%d", sum); [3] b) Write a program to determine whether a number is a deficient number or not. A number is deficient if the summation of its factors is less than double of the number. For example, 15 is a deficient number as the sum of its factors (1+3+5+15=24) is less than 30(double of 15). On the other hand, 24 is not a deficient number. Because the sum of the factors of 24(1,2,3,4,6,8,12,24) is 60 which is larger than double of 24.[3]4 a) Show the manual tracing (show the values of all the variables and array elements in each step) for the following code segment int F[6]={0}; int i; F[0]=1; F[1]=1; for(i=2; i<=5; i++){ F[i]=F[i-1]+F[i-2]; printf(%d %d %d
, F[i-2], F[i-1], F[i]); } printf(%d %d %d, F[i-2], F[i-1], F[i-1]+F[i-2]); [2] b) Write a Program that will take n integer numbers into an array, and then find the maximum minimum among them with the index positions. Sample input Sample output 512345 Max: 5, Index: 4 Min: 1, Index: 06283901 Max: 9, Index: 3 Min: 0, Index: 4[4]5 a) Draw a flowchart that always displays the following menu. It also takes a choice from the user and handle according to the menu. Enter 1, to display SPL is fun! Enter 2, to display (On campus) University life is the Best! Enter q, to quit. [2] b) Write a C program that takes an integer value n, and draw the pattern below. Sample input, n Sample output 3 x x x x x 5 x x x x x x x x x [4].solve it c language

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!