@@ -0,0 +1,2012 @@
+//Deepanker Saxena%0A%0Aimport java.io.IOException;%0Aimport java.net.InetAddress;%0Aimport java.net.UnknownHostException;%0Aimport java.util.ArrayList;%0Aimport java.io.*;%0Aimport java.util.*;%0Aimport java.lang.*;%0Aimport java.io.BufferedWriter;%0Aimport java.text.DateFormat;%0Aimport java.text.SimpleDateFormat;%0Aimport java.util.Calendar;%0Aimport java.util.Date;%0A%0Apublic class Ping%0A%7B%0A%0A%0Apublic static void main(String%5B%5D args) throws FileNotFoundException, IOException,UnknownHostException%0A%7B%0A%0AFileInputStream f1 = new FileInputStream (%22ips.txt%22);%0ABufferedInputStream bis = new BufferedInputStream(f1);%0A%0Aint c;%0AString d=%22%22;%0Achar a;%0Awhile((c=f1.read())!= -1)%0A%7B%0Aa=(char)c;%0Ad= d+ a;%0A%7D%0Abis.close();%0A%0ASystem.out.println(%22Welcome %22 + %22 Let's Ping%22+%22%5Cn%22);%0A%0AFileWriter fw = new FileWriter(%22pingresult.xls%22);%0ABufferedWriter bw = new BufferedWriter(fw);%0ADate date1 = new Date();%0A%09 DateFormat dateFormat = new SimpleDateFormat(%22dd/MM/yyyy%22);%0A    String dateFormatted = dateFormat.format(date1);%0A    %0Abw.write(%22Date%22 + %22Ip%22 +%22%5Ct%22 + %22Status%22+%22%5Cn%22);%0A%0AString sarr%5B%5D = d.split(%22;%22);%0A%0Afor(int z=0;z%3Csarr.length;z++)%0A%7B%0A//System.out.println(sarr%5Bz%5D + %22%5Cn%22);%0A%0Atry %7B%0A%0AInetAddress inet = InetAddress.getByName(sarr%5Bz%5D);%0A          System.out.println(%22Sending Ping Request to %22 + sarr%5Bz%5D+%22%5Cn%22);%0A%0A          System.out.println(%22Host is reachable: %22+inet.isReachable(5000) +%22%5Cn%22);%0A%09%09  %0A%09%09  if(inet.isReachable(5000))%0A%09%09  %7B%0A%09%09  String temp1=sarr%5Bz%5D+ %22%5Ct%22+%22Alive%22+ %22%5Cn%22;%0A%09%09  bw.write(dateFormatted+%22%5Ct%22);%0A%09%09  bw.write(temp1);%0A%09%09  System.out.println(temp1);%0A%09%09  %7D%0A%09%09  else%0A%09%09  %7B%0A%09%09  String temp2 = sarr%5Bz%5D +%22%5Ct%22+%22Dead%22+%22%5Cn%22;%0A%09%09  bw.write(dateFormatted+%22%5Ct%22);%0A%09%0A%09%09  System.out.println(temp2);%0A%09%09  bw.write(temp2);%0A%09%09  %7D%0A     %7D%0A%09 catch (UnknownHostException e)%0A%7B%0A     System.err.println(%22Host does not exists%22+%22%5Cn%22);%0Abw.write(sarr%5Bz%5D + %22%5Ct%22+%22Dead ( Host Doesn't Exist )%22+ %22%5Cn%22);%0A%09%09  %0A%09 %7D%0Acatch (IOException e)%0A%7B%0A     System.err.println(%22Error in reaching the Host%22+%22%5Cn%22);%0A%09 bw.write(sarr%5Bz%5D + %22%5Ct%22+ %22Dead ( Error Reaching Host ) %22+%22%5Cn%22);%0A%09%09  %0A%7D%0A%0A%7D%0Abw.close();%0A%7D%0A%7D%0A

Create Ping.java