🔒 Closed C programming beginner

Status
Not open for further replies.
here, dugtungin mo logical operator
nadiretsyo na sya sa CATASTROPHE pag nag input ako ng 5.6 imbis na SERIOUS DAMAGE
 

Attachments

  • Screenshot from 2019-08-01 12-33-44.webp
    Screenshot from 2019-08-01 12-33-44.webp
    51.1 KB · Views: 24
#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
 
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
ganito ba paps?
 

Attachments

  • Screenshot from 2019-08-01 13-03-35.webp
    Screenshot from 2019-08-01 13-03-35.webp
    31.6 KB · Views: 25
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

  • 222.png
    222.png
    17.4 KB · Views: 16
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

  • Screenshot from 2019-08-01 13-12-56.webp
    Screenshot from 2019-08-01 13-12-56.webp
    39.8 KB · Views: 28
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.

About this Thread

  • 56
    Replies
  • 3K
    Views
  • 12
    Participants
Last reply from:
Ph_Bunker

Trending Topics

Online now

Members online
1,180
Guests online
1,298
Total visitors
2,478

Forum statistics

Threads
2,288,327
Posts
29,050,728
Members
1,215,010
Latest member
JoshJoshJosh62
Back
Top