Java Engineering Programs Blog

Full Adder program in java

Full Adder program in java

import java.util.*; class FULLADDER { public static void main(String args[]) { int a[],b[]; Scanner sc=new Scanner(System.in); System.out.println(“ENTER NUMBER OF BITS : “); int n=sc.nextInt(); a=new int[n]; b=new int[n]; System.out.println(“ENTER ELEMENTS : \nA CONTAINS:”); for(int...

Client Server program in java

Client Server program in java

TCPClient.java File import java.io.*; import java.net.*; class TCPClient { public static void main(String argv[]) throws Exception { String FromServer; String ToServer; Socket clientSocket = new Socket(“localhost”, 5000); BufferedReader inFromUser =new BufferedReader(new InputStreamReader(System.in)); PrintWriter outToServer...

Hamming Code program in java

Hamming Code program : import java.io.*; import java.util.*; class Hamming { public static void main(String args[])throws IOException { Scanner sc=new Scanner(System.in); int m,h[],n,d[],i=0,j,k,x=0,sum=0,count=0; System.out.print(“Enter no. of data bits : “); n=sc.nextInt(); while(n>(Math.pow(2,i))) { i++;...

Fibonacci series program in java

Fibonacci series program in java

Learn Java Programming for Beginners import java.util.*; class Fibonacci_series { public static void main(String args[])throws Exception { int f,q,i=0; Scanner sc=new Scanner(System.in); System.out.println(“Enter a number: “);       //input how many no is Fibonacci...