Question

All in C please~ #1 Consider this program: #include <stdio.h> int main () { /* main...

All in C please~

#1 Consider this program:

#include <stdio.h>

int main () { /* main */

constint constant1 = 10, constant2 = 20,

constant3 = 14;

int input_value;

char current_truth;

printf("What is the input value?\n"); scanf("%d", &input_value);
current_truth = input_value > constant1; printf("current_truth = %d\n", current_truth); current_truth =

current_truth && (input_value < constant2); printf("current_truth = %d\n", current_truth); current_truth =

current_truth && (input_value == constant3); printf("current_truth = %d\n", current_truth);

} /* main */

What is the output of this program for the following inputs?

(a) 8

(b) 14

(c) 16

(d) 20

0 0
Add a comment Improve this question Transcribed image text
Answer #1

a)
current_truth = 0
current_truth = 0
current_truth = 0

b)
current_truth = 1
current_truth = 1
current_truth = 1

c)
current_truth = 1
current_truth = 1
current_truth = 0

d)
current_truth = 1
current_truth = 0
current_truth = 0
Add a comment
Know the answer?
Add Answer to:
All in C please~ #1 Consider this program: #include <stdio.h> int main () { /* main...
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
ADVERTISEMENT