Question: ( algorithms , C - Overview, selection statements ) Provide short Answers only for 2 1 to 2 5 . Rewrite the if statement below

(algorithms, C-Overview, selection statements)
Provide short Answers only for 21 to 25.
Rewrite the if statement below using only the relational
operator in all conditions. Assume that the value of score
is between 0 and 100 inclusive.
if (score 90)
else if (score 80)
else
paiatf("C
"):
What do these statements display?
a. if (1212)
grintf("less"):
else
pointft" not less");
output: not less
b. var1=2512:
var2=1500;1500
if (var1var2)
else
p6iotft"less or equal");
briotfte"greater than");
output: greater than
Write an if statement that might be used to compute and
display the average of a set of n numbers whose sum is stored
in variable total. This average should be found only if n is
greater than 0; otherwise, an error message should be
displayed.
if (n>0)
printf("Average: d?
",(total/n));
else
printf("Error: n0?
");
Write a C programming expression to test for each of the
following relationships.
a. age is from 18 to 21 inclusive.
b. water is less than 1.5 and also greater than 0.1.
c. year is divisible by 4.(Hint: Use 2a.)
d. speed is not greater than 55.
e.y is greater than x and less than z.
f.w is either equal to 6 or not greater than 3.
Write C assignment statements for the following:
a. Assign a value of 0 to between if n is less than -k or
greater than +k; otherwise, assign 1.
b. Assign a value of 1 to divisor if digit is a divisor of
num; otherwise, assign a value of 0.
c. Assign a value of 1 to lowercase if > is a lowercase
letter; otherwise, assign a value of 0.
Algorithms and Programming:
Assume we want to write an interactive C program that uses
selection statements to compute the area of a square (area =
side * side) or a circle (area = PI * radius* radius) after
prompting the user to choose the first character of the chosen
figure name S or C) lowercase letters also included. Answer
the following questions:
6.1 What are the input and output variables?
6.2 Draw the corresponding Raptor flowchart to represent this
algorithm (provide a screenshot only in the same word
document)
6.3 Write the complete c program to represent this algorithm
(copy the source code also in the same word document with
screenshots of the program output).
6.4 What gof command(s) will be used to compile, link, and
execute this program?
 (algorithms, C-Overview, selection statements) Provide short Answers only for 21 to

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!