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;

}

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;

}

``

## Comments

## Leave a comment