Hopefully when I'm done with all the exercise, that comes with this ebook that I have then I will be able to make something nice.You never know maybe I will create a nice GUI tool to organize all you favorite Nightcore songs :P
//Going to solve this later today when I get some more sleep :D
3: The following program has unnecessarily complex relational expressions as well as some outright errors. Simplify and correct it
Code: Select all
#include <stdio.h>
int main(void) /* 1 */
{ /* 2 */
int weight, height; /* weight in lbs, height in inches */
/* 4 */
scanf("%d, weight, height); /* 5 */
if (weight < 100) /* 6 */
if (height >= 72) /* 7 */
printf("You are very tall for your weight.\n");
else if (height < 72 && > 64) /* 9 */
printf("You are tall for your weight.\n");
else if (weight > 300 && ! (weight <= 300)) /* 11 */
if (!(height >= 48) /* 12 */
printf(" You are quite short for your weight.\n");
else /* 14 */
printf("Your weight is ideal.\n"); /* 15 */
/* 16 */
return 0;
}