473,769 Members | 4,591 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I would like to ask the code in C about truth tables?

5 New Member
Given the truth values of the propositions p and q, display the truth values of the conjunction, disjunction, exclusive or, conditional statement, and biconditional of these propositions.

Can you help me with this problem? Is this easy? If possible can you write the code? or if it's too long can you just help me what should i do? Thanks. I really need it badly. =D Thanks. Much Appreciated.
Jan 5 '11 #1
7 3612
donbock
2,426 Recognized Expert Top Contributor
Note to the OP (and only the OP):
Please describe what the terms conjunction, disjunction, exclusive or, conditional, and biconditional mean in this context. Use whatever format is most natural for you (Boolean algebra, predicate logic, computer source code, etc).

What language does this program need to be written in?
Jan 5 '11 #2
papacologne
5 New Member
The program should be written in C language. Is it easy?
Jan 5 '11 #3
papacologne
5 New Member
The truth values of the following such as when the the value of p and q is true. then i choose i.e conjuction. it will display the value of p and q. if you can give an advice on making this program in c. or just the code in c.
Jan 5 '11 #4
donbock
2,426 Recognized Expert Top Contributor
"Is it easy?"
That depends on how complicated those 5 operations are. Please describe them to us.

For example, here's the description of exclusive-or:
exclusive-or = (p AND (NOT q)) OR ((NOT p) AND q)

Meanwhile, you should familiarize yourself with the logical operators in C (!, ||, &&).

Nobody on this site will write the code for you.
Jan 5 '11 #5
papacologne
5 New Member
Oh. Okay to clear things up. If possible if you can give me advice on what should i do first in making the truth values work. There is no need for the symbols to be written. Just a simple input and output. Example. The program ask for the value of p and q. If p is true and q is false, then if entered the conjuction proposition, then the value given will be F. Because T and F = F. another example is if it's biconditional. if p = false <-> q = false then it will display false. Something like this. Not to be complicated. Just to make it simple. =D
Jan 5 '11 #6
donbock
2,426 Recognized Expert Top Contributor
I encourage you to write out the expressions. Doing so is half the effort of writing the program!

Does your program need to be interactive (the user enters the values of p and q) or does your program simply print out the truth tables for these functions?
Jan 5 '11 #7
papacologne
5 New Member
I will sooner or later when the time comes. But i need to do some basic stuff first. No. My program is interactive. Thanks in advance. Much appreciated.
Jan 5 '11 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

4
1285
by: MS | last post by:
I'm strictly an amteur. Self taught via the help files. Here is an example of a DB I've done. It is quite simple to some of the ones I do for my workplace, but it is an example of the way i work. I have received enormous help from this NG over the years, and I was wondering if you experts could have a look and see how I'm doing, and if I'm doing anything blatantly silly. This app is to quickly calculate the cost of transport around...
171
7796
by: tshad | last post by:
I am just trying to decide whether to split my code and uses code behind. I did it with one of my pages and found it was quite a bit of trouble. I know that most people (and books and articles) like it because you can split the code from the design. That is logical. But if you are the only one working on the code, it seem a little overkill. I use Dreamweaver to do my design and find it a bit of a hassle to have multiple files open...
29
3680
by: John Rivers | last post by:
Hello, What good reason there is for not allowing methods in ASPX pages I can't imagine, but here is how to get around that limitation: (START) <body MS_POSITIONING="FlowLayout"> <form id="Form1" method="post" runat="server"> <%
59
3669
by: phil-news-nospam | last post by:
In followups by Brian O'Connor (ironcorona) to other posts, he repeats the idea that using tables in CSS is not something that should be done because IE doesn't support it. Of course I'm not happy about the fact that IE doesn't support CSS tables. But what can one do about that? And tables of one type or the other are needed in some cases (regardless of whether some people feel it is appropriate or not). So the issue I and considering...
5
1700
by: SharpCoderMP | last post by:
is it possible to implement some safe way of performing two or more instructions in a kind of "atomic" way? consider this: we have two queues (implemented on top of an List<T>). now we need to move an element from one queue to another, so we need to do something like this: queue2.Enqueue(queue1.Dequeue()); int this case we may assume that nothing can cause this to fail resulting in loss of the object we want to move.
0
2323
by: Alan Woods | last post by:
Hi, I need to query on some data. The data is from SMS2003, stored in SQL2005, all on a Windows2003 server. I write a few queries, but I consider myself an SQL beginner at best. Normally, I write simple queries like "select column1, column2, column4 from a_table where column2 = 'something'". That's about 90% of my writing ability. Here's the challenge: I need a query that can query a table and select a list of other tables and then list...
6
11450
by: ambanks04 | last post by:
ok taking computer science class anybody know what to do i am not computer literate CoSc 111.003 Spring 2008 Assignment 4 1) Each student shall design, develop, code, test and submit an Original computer program which uses a function or functions to display the TRUTH TABLES for the Logical And, the Logical Or, and the Logical Not operators., as defined in Section 5.8, of the text, 5Th/6Th Edition. 2) The program shall: ...
3
6494
by: masonic35and7 | last post by:
I work for a school district, and I have just imported 6 Excel worksheets into Access 2007. Now I have 6 different tables. In each table all the fields are the same. I need the easiest way to merge all the tables into one huge table. There are at least 2,500 records per table if that makes a difference. I am unfamilar with writing any type of code, so please don't suggest that unless you can also tell me how to do that. Thanks
3
5129
by: Bret Kuhns | last post by:
I recently started a co-op/internship at a company and they are looking to migrate a large legacy supported application from OLEDB to SQL Server. I'm doing prelim work in experimenting with the options available. The application is huge (1+ million lines of C++ code), so it'd be quite a bit of man hours to adapt all the database code for SQL Server. I stumbled upon linked tables in an OLEDB file to an ODBC source (such as SQL Server) and...
5
6595
by: andrea | last post by:
Well I would like to make a little program that given a certain logical expression gives the complete truth table. It's not too difficult in fact, I just have some doubts on how to design it. I thought something like that: class Term:
0
9424
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10223
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10000
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9866
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8879
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3968
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.