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

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

    printf (“True”);


    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?

    Well the first thng to do is use de morgan's law on the statement.
Submit reply
Turn on thread page Beta
Updated: November 2, 2015
Are you going to a festival?
Useful resources

Make your revision easier


Maths Forum posting guidelines

Not sure where to post? Read the updated guidelines here


How to use LaTex

Writing equations the easy way

Student revising

Study habits of A* students

Top tips from students who have already aced their exams

Study Planner

Create your own Study Planner

Never miss a deadline again

Polling station sign

Thinking about a maths degree?

Chat with other maths applicants

Can you help? Study help unanswered threads

Groups associated with this forum:

View associated groups

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...
Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.