What's new

Closed C programming beginner

Status
Not open for further replies.
#include <stdio.h>

int main()
{
float richterno;
richterno=0;
printf("ENTER RICHTER NUMBER: ");
scanf("%f",&richterno);

if (richterno<5) {
printf("LITTLE OR NO DAMAGE \n");
} else if (richterno >= 5 && richterno < 5.5) {
printf("SOME DAMAGE \n");
} else if (richterno >= 5.6 && richterno < 6.5) {
printf("SERIOUS DAMAGE \n");
} else if (richterno >= 6.6 && richterno < 7.5) {
printf("DISASTER \n");
} else {
printf("CATASTROPHE \n");
}

return 0;

}

pwede pa lagay dito ng code? try ko dito ayusin
 
#include <stdio.h>

int main()
{
float richterno;
richterno=0;
printf("ENTER RICHTER NUMBER: ");
scanf("%f",&richterno);

if (richterno<5) {
printf("LITTLE OR NO DAMAGE \n");
} else if (richterno >= 5 && richterno < 5.5) {
printf("SOME DAMAGE \n");
} else if (richterno >= 5.6 && richterno < 6.5) {
printf("SERIOUS DAMAGE \n");
} else if (richterno >= 6.6 && richterno < 7.5) {
printf("DISASTER \n");
} else {
printf("CATASTROPHE \n");
}

return 0;

}
basta numbers, intact mo 5, 5.5, 6.5, 7.5, dahil kung lagyan mo ng 5.6 sa logical operator, 5.5 to 5.59 di nya ininclude and so forth
 
try mo to:
#include <stdio.h>

int main()
{
float richterno;

printf("ENTER RICHTER NUMBER: ");
scanf("%f",&richterno);

if (richterno < 5)
{
printf("LITTLE OR NO DAMAGE \n");
}
else if (richterno >= 5 && richterno <= 5.5)
{
printf("SOME DAMAGE \n");
}
else if (richterno >5.5 && richterno <= 6.5)
{
printf("SERIOUS DAMAGE \n");
}
else if (richterno > 6.5 && richterno <= 7.5)
{
printf("DISASTER \n");
}
else
{
printf("CATASTROPHE \n");
}

return 0;

}
 
ganito ba paps?
ganito, try mo copy code ko, working kasi saken or try mo kay spectaculariE same lang e

#include <stdio.h>

int main()
{
float richterno;

printf("Enter Richter Scale: ");
scanf("%f",&richterno);

if (richterno < 5){
printf("No Damage");
}
else if (richterno >= 5 && richterno < 5.5 ) {
printf("Some Damage");
}
else if (richterno >= 5.5 && richterno < 6.5 ) {
printf("Serious Damage");
}
else if (richterno >= 6.5 && richterno < 7.5 ) {
printf("Disaster");
}
else{
printf("Catastrophe");
}
return 0;
}
 

Attachments

Last edited:
try mo to:
#include <stdio.h>

int main()
{
float richterno;

printf("ENTER RICHTER NUMBER: ");
scanf("%f",&richterno);

if (richterno < 5)
{
printf("LITTLE OR NO DAMAGE \n");
}
else if (richterno >= 5 && richterno <= 5.5)
{
printf("SOME DAMAGE \n");
}
else if (richterno >5.5 && richterno <= 6.5)
{
printf("SERIOUS DAMAGE \n");
}
else if (richterno > 6.5 && richterno <= 7.5)
{
printf("DISASTER \n");
}
else
{
printf("CATASTROPHE \n");
}

return 0;

}
okay na paps!!!!!!
super wow, effective and totally working paps
SUPER THANK YOUU
 

Attachments

ganito, try mo copy code ko, working kasi saken or try mo spectaculariE same lang e

#include <stdio.h>

int main()
{
float richterno;

printf("Enter Richter Scale: ");
scanf("%f",&richterno);

if (richterno < 5){
printf("No Damage");
}
else if (richterno >= 5 && richterno < 5.5 ) {
printf("Some Damage");
}
else if (richterno >= 5.5 && richterno < 6.5 ) {
printf("Serious Damage");
}
else if (richterno >= 6.5 && richterno < 7.5 ) {
printf("Disaster");
}
else{
printf("Catastrophe");
}
return 0;
}
SIGE PAPS,try ko
 
Status
Not open for further replies.

Similar threads

Back
Top