Hey there! Sign in to join this conversationNew here? Join for free
x Turn on thread page Beta
    • Thread Starter
    Offline

    1
    ReputationRep:
    Consider these lines of code from a C program:
    if (!(x!=0 && y/x < 1)|| x==0)

    printf (“True”);

    else

    printf (“False”);

    a. Express the code in this statement as a compound statement using the logical connectives and these predicates

    E(x): x = 0

    L(x,y): y/x < 1

    A(z): “z is assigned to printf”

    where x and y are integers and z is a Boolean variable (with values True and False)

    b. Use the laws of propositional logic to simplify the statement by expressing it in a simpler form.

    c. Translate the answer in part (b) back into C codes.

    How can it be solved in easiest way? need help thank you
 
 
 
Reply
Submit reply
Turn on thread page Beta
Updated: November 2, 2015
Poll
Are you going to a festival?

The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

Write a reply...
Reply
Hide
Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.