Subnetting (Java)

Problem Definition: Write a program to implement subnetting and find the subnet masks. import java.util.Scanner; class Subnet{ public static void main(String args[]){ Scanner sc = new Scanner(; System.out.print(“Enter the ip address: “); String ip = sc.nextLine(); String split_ip[] = ip.split(“\\.”); //SPlit the string after every . String split_bip[] = new String[4]; //split binary ip String bip = “”; for(int i=0;i<4;i++){ split_bip[i] = appendZeros(Integer.toBinaryString(Integer.parseInt(split_ip[i]))); // “18” … Continue reading Subnetting (Java)