Answer to Question #51271 in C for christian francis del mundo

Question #51271
The national earthquake information center has the following criteria to determine the earthquake’s damage. Here are the given richter scale criteria and their corresponding characterization. The richter scale serves as the inoput data and the characterization as output information. Richter Number (n) Characterization N<5.0 Little Or No Damage 5.0>=N<5.5 Some Damage 5.5>=N<6.5 Serious Damage 6.5>=N<7.5 Disaster Higher Catastrophe
Expert's answer
#include <stdio.h>
int main() {
float n;
// Input
printf("Richter Number: ");
scanf("%f", &n);
// Output
if (n < 5) {
printf("Characterization: Little Or No Damage");
} else if (n >= 5 && n < 5.5) {
printf("Characterization: Some Damage");
} else if (n >= 5.5 && n < 6.5) {
printf("Characterization: Some Damage");
} else if (n >= 6.5 && n < 7.5) {
printf("Characterization: Serious Damage");
} else {
printf("Characterization: Higher Catastrophe");
}
return 0;
}


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS
paypal