Skip to main content
We are aware of an issue preventing new threads and posts from being created. We are actively working on a fix. Thank you for your patience.

Daddy Electons "Chit-Chat"

Here you can discuss anything you want to about the elections.

6 Replies

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.

Kind regards,
Donk
Bytro game addict and avid CoW player.
"Þ" > "th"
Слава
Україні!

412 for the win!

TMC

Donk2.0 wrote:

#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.

check your indexing and brackets. Usually that’s the problem. Otherwise, use AI to solve the problem.
Looking for improvement.

JASLOLY wrote:

Donk2.0 wrote:

#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.

check your indexing and brackets. Usually that’s the problem. Otherwise, use AI to solve the problem.
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.
Kind regards,
Donk
Bytro game addict and avid CoW player.
"Þ" > "th"
Слава
Україні!

Post a Reply

Please log in to post a reply.

Back to Discussions
Quick Launch