Question
Programming in C language.
Write the code that will test the vakue of an integer variable grade and performs the following actions: if grade is .print t
0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include <stdio.h>

int main()
{
int grade = 7;
if(grade == 6) {
printf("Sixth grade\n");
} else if(grade == 7) {
printf("Seventh grade\n");
} else if(grade == 8) {
printf("Eighth grade\n");
} else {
printf("Not in middle school\n");
}
return 0;
}

Output:

$gcc -o main *.c
$main
Seventh grade
Add a comment
Know the answer?
Add Answer to:
Programming in C language. Write the code that will test the vakue of an integer variable...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT