How would questions 5 and 6 be answered? C statements Read the following code. F
ID: 3870646 • Letter: H
Question
How would questions 5 and 6 be answered? C statements
Explanation / Answer
5.
Category
Rate
Total
M
21
42
H
12
100
G
20
120
6.
#include<stdio.h>
int main()
{
int rate = 20;
total = 100;
char category ;
scanf("%c",&category);
if(category=='M')
{
rate++;
total = rate * 2;
}
else if(category=='F')
{
total = rate * 2;
}
else if(category=='H'||category=='D')
{
rate=(int)(total/8);
}
else
total+=rate;
}
Category
Rate
Total
M
21
42
H
12
100
G
20
120