C program to print the Logic gates(AND, OR, NOT, NAND, NOR, XOR) - Data Structure using C

Translate

Sunday, December 13, 2020

C program to print the Logic gates(AND, OR, NOT, NAND, NOR, XOR)

C program to print the LOgic gates(AND, OR, NOT, NAND, NOR, XOR). take input from the user.

code👇👇👇👇👇👇👇👇👇


#include<stdio.h>
int main()
{
int a,b;
printf("Enter input a=");
scanf("%d",&a);
printf("Enter input b=");
scanf("%d",&b);
printf("a AND b = %d\n",a&b);
printf("a OR b = %d\n",a|b);
printf("NOT a = %d\n",!a);
printf("a NAND b = %d\n",!(a&b));
printf("a NOR b = %d\n",!(a|b));
printf("a XOR b = %d\n",a^b);
return 0;
}


No comments:

Post a Comment

Introduction to Arrays

  Introduction to Arrays An array is a data structure that allows you to store a collection of elements of the same type. Each element in th...