INTRODUCTION
NAME :- AVINESH PADAYACHI
CLASS :- FYIT DIV :- B
ROLL NO :- 2538
TOPIC :- Creating Truth Table of Logical
Connectives By Using HTML
Discription :-
A Logical Connective is a symbol which is used to connect two or more
propositional or predicate logics in such a manner that resultant logic
depends only on the input logics and the meaning of the connective used.
Generally there are five connectives which are −
OR (∨)
AND (∧)
Negation/ NOT (¬)
If and only if (⇔).
Implication / if-then (→)
Negation (¬) – The negation of a proposition p (written as ¬ p) is false
when p is true and is true when p is false.
AND (∧) – The AND operation of two propositions p and q (written as p∧q) is true if both the
propositional variable p and q is true.
OR (∨) − The OR operation of two propositions p and q (written as p ∨ q) is true if
at least any of the propositional variable p or q is true.
if-then (→) − An implication p → q is the proposition “if p, then q”. It is false if p is
true and q is false. The rest cases are true.
If and only if (⇔) – p ⇔ q is bi-conditional logical connective which is true when p
and q are same, i.e. both are false or both are true.
PROGRAM :-
[1] Negation/Not (~)
<!DOCTYPE html>
<html>
<head>
<title>table</title>
<style>
table{
border-collapse: collapse;
width: 100%;
th,td{
border: 2px solid green;
padding: 15px;
</style>
</head>
<body>
<table>
<tr>
<th>P</th>
<th>~P</th>
</tr>
<tr>
<td style="text-align:center">T</td>
<td style="text-align:center">F</td>
</tr>
<tr>
<td style="text-align:center">F</td>
<td style="text-align:center">T</td>
</tr>
</table>
</body>
</html>
OUTPUT :-
[2] Conjunction/And (∧)
<!DOCTYPE html>
<html>
<head>
<title>table</title>
<style>
table{
border-collapse: collapse;
width: 100%;
th,td{
border: 2px solid green;
padding: 15px;
</style>
</head>
<body>
<table>
<tr>
<th>p</th>
<th>q</th>
<th>p∧q</th>
</tr>
<tr>
<td style="text-align:center">T</td>
<td style="text-align:center">T</td>
<td style="text-align:center">T</td>
</tr>
<tr>
<td style="text-align:center">T</td>
<td style="text-align:center">F</td>
<td style="text-align:center">F</td>
</tr>
<tr>
<td style="text-align:center">F</td>
<td style="text-align:center">T</td>
<td style="text-align:center">F</td>
</tr>
<tr>
<td style="text-align:center">F</td>
<td style="text-align:center">F</td>
<td style="text-align:center">F</td>
</tr>
</table> </body> </html>
OUTPUT :-
[3] Disjunction/OR (V)
<!DOCTYPE html>
<html>
<head>
<title>table</title>
<style>
Table{
Border-collapse: collapse;
Width: 100%;
Th,td{
Border: 2px solid green;
Padding: 15px;
</style>
</head>
<body>
<table>
<tr>
<th>p</th>
<th>q</th>
<th>pVq</th>
</tr>
<tr>
<td style=”text-align:center”>T</td>
<td style=”text-align:center”>T</td>
<td style=”text-align:center”>T</td>
</tr>
<tr>
<td style=”text-align:center”>T</td>
<td style=”text-align:center”>F</td>
<td style=”text-align:center”>T</td>
</tr>
<tr>
<td style=”text-align:center”>F</td>
<td style=”text-align:center”>T</td>
<td style=”text-align:center”>T</td>
</tr>
<tr>
<td style=”text-align:center”>F</td>
<td style=”text-align:center”>F</td>
<td style=”text-align:center”>F</td>
</tr>
</table> </body> </html>
OUTPUT :-
[4] Conditional/if then (→)
<!DOCTYPE html>
<html>
<head>
<title>table</title>
<style>
Table{
Border-collapse: collapse;
Width: 100%;
Th,td{
Border: 2px solid green;
Padding: 15px;
</style>
</head>
<body>
<table>
<tr>
<th>p</th>
<th>q</th>
<th>p→q</th>
</tr>
<tr>
<td style=”text-align:center”>T</td>
<td style=”text-align:center”>T</td>
<td style=”text-align:center”>T</td>
</tr>
<tr>
<td style=”text-align:center”>T</td>
<td style=”text-align:center”>F</td>
<td style=”text-align:center”>F</td>
</tr>
<tr>
<td style=”text-align:center”>F</td>
<td style=”text-align:center”>T</td>
<td style=”text-align:center”>T</td>
</tr>
<tr>
<td style=”text-align:center”>F</td>
<td style=”text-align:center”>F</td>
<td style=”text-align:center”>T</td>
</tr> </table> </body> </html>
OUTPUT :-
[5] Biconditional/if and only if (⇔)
<!DOCTYPE html>
<html>
<head>
<title>table</title>
<style>
Table{
Border-collapse: collapse;
Width: 100%;
Th,td{
Border: 2px solid green;
Padding: 15px;
</style>
</head>
<body>
<table>
<tr>
<th>p</th>
<th>q</th>
<th>p⇔q</th>
</tr>
<tr>
<td style=”text-align:center”>T</td>
<td style=”text-align:center”>T</td>
<td style=”text-align:center”>T</td>
</tr>
<tr>
<td style=”text-align:center”>T</td>
<td style=”text-align:center”>F</td>
<td style=”text-align:center”>F</td>
</tr>
<tr>
<td style=”text-align:center”>F</td>
<td style=”text-align:center”>T</td>
<td style=”text-align:center”>F</td>
</tr>
<tr>
<td style=”text-align:center”>F</td>
<td style=”text-align:center”>F</td>
<td style=”text-align:center”>T</td>
</tr> </table> </body> </html>
OUTPUT :-