x Turn on thread page Beta
 You are Here: Home >< Maths

# Programming and discrete maths problem watch

1. 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?
2. Well the first thng to do is use de morgan's law on the statement.

Turn on thread page Beta
TSR Support Team

We have a brilliant team of more than 60 Support Team members looking after discussions on The Student Room, helping to make it a fun, safe and useful place to hang out.

This forum is supported by:
Updated: November 2, 2015
Today on TSR

### Negatives of studying at Oxbridge

What are the downsides?

Poll
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

### Study habits of A* students

Top tips from students who have already aced their exams

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