FATHER
CarKing the 6th of the Abrahamic Caliphate
Here you can discuss anything you want to about the elections.
FATHER
Shhhhhh
#include
int main(void) {
//interrogation regarding mass
int mass;
printf(" What is your objects mass?\n");
scanf("%d", &mass);
int weight = mass * 9.8;
printf(" Your object is %d newtons.\n", weight);
// if statements
if (weight > 1000) {
printf("Your object is over 1000 newtons, it is too heavy.\n");
}
else if (weight < 10) {
printf("Your object is under 10 newtons, it is too light.\n");
}
return 0;
}
Unrelated, but can anyone run this code without an error? I kept on getting one but now its gone. It's C code lang.
412 for the win!
check your indexing and brackets. Usually that’s the problem. Otherwise, use AI to solve the problem.Donk2.0 wrote:
#includeint main(void) {
//interrogation regarding mass
int mass;
printf(" What is your objects mass?\n");
scanf("%d", &mass);
int weight = mass * 9.8;
printf(" Your object is %d newtons.\n", weight);
// if statements
if (weight > 1000) {
printf("Your object is over 1000 newtons, it is too heavy.\n");
}
else if (weight < 10) {
printf("Your object is under 10 newtons, it is too light.\n");
}
return 0;
}
Unrelated, but can anyone run this code without an error? I kept on getting one but now its gone. It's C code lang.
Yes, I'm pretty sure the error ended up being related to the brackets. The program used the wrong ones in some spots. It works fine now though.JASLOLY wrote:
check your indexing and brackets. Usually that’s the problem. Otherwise, use AI to solve the problem.Donk2.0 wrote:
#includeint main(void) {
//interrogation regarding mass
int mass;
printf(" What is your objects mass?\n");
scanf("%d", &mass);
int weight = mass * 9.8;
printf(" Your object is %d newtons.\n", weight);
// if statements
if (weight > 1000) {
printf("Your object is over 1000 newtons, it is too heavy.\n");
}
else if (weight < 10) {
printf("Your object is under 10 newtons, it is too light.\n");
}
return 0;
}
Unrelated, but can anyone run this code without an error? I kept on getting one but now its gone. It's C code lang.
Please log in to post a reply.