Write a program of logic gates.

import logicgate.And;
import logicgate.Or;
import logicgate.Not;
import java.util.Scanner;

class Gate
{
public static void main(String[] args)
{
  int a,b;
System.out.println("Enter Values");
 Scanner sc=new Scanner(System.in);
  And and=new And();
  Or or=new Or();
  Not not=new Not();

a=sc.nextInt();
b=sc.nextInt();

and.doOperation(a,b);
or.doOperation(a,b);
not.doOperation(a);
}
}

No comments:

Post a Comment