I attached my program: Question: Are there values of a, b, and c that would make
ID: 3602483 • Letter: I
Question
I attached my program:
Question:
Are there values of a, b, and c that would make all the results False? Submit your answer to this question as a comment in your program. Please explain clearly how you have arrived at this answer. Hint: It may be useful to start with the last expression and work backwards.
#include<stdio.h>
int main()
{
//declare variable a, b , c
int a, b, c;
//ask user to input
printf("Enter three integers a, b, c: ");
scanf("%d%d%d", &a, &b, &c);
if (!a || !b++ && c)
printf("!a|| !b++ && c: True ");
else
printf("!a||!b++ && c: False ");
if ((a - 1 || b / 2) && (c *= 2))
printf("(a - 1|| b / 2) && (c *= 2): True ");
else
printf("(a - 1||b / 2) && (c *= 2): False ");
if ((a-- || --b) && (c += 2))
printf("(a-- || --b) && (c += 2): True ");
else
printf("(a-- || --b) && (c += 2): False ");
if (a || !(b && --c))
printf("a || !(b && --c): True ");
else
printf("a || !(b && --c): False ");
}
Write a C program, called logic abc.c, that prompts the user to enter three integers a, b, c, and then computes the results of the following logical operations, in sequence: (a-1 b/2)&&(c 2) Here are three sample runs of this a program, assuming that the executable file is called logic abc. /home/userXYZ/ECE15/Labl> logic abc Enter integers a, b,c:111 !a I b++ &&c;: False && (2):True (a-- II-b) && (c+-2): True a II !(b &&--c) False /home/userXYZ/ECE15/Labl> logic abc Enter integers a,b, c: -7 42 0 la I b++&&c;: False (a-1 II b/2)&& (c 2): False (a-- II b)&&(c+-2): True a II !(b &&--c): True /home/userXYZ/ECE15/Labl> logic abo Enter integers a,b, c: 100 1000 (a-1 b/2) &&(C 2) True a II !(b&&-c): True Are there values of a, b, and c that would make all the results False? Submit your answer to this question as a comment in your program. Please explain clearly how you have arrived at this answer Hint: It may be useful to start with the last erx expression and work backwardsExplanation / Answer
Enter three integers a, b, c: 1 -2 -2
!a||!b++ && c: False
(a - 1||b / 2) && (c *= 2): False
(a-- || --b) && (c += 2): False
a || !(b && --c): False
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.