<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5267022146033422138</id><updated>2026-01-02T01:34:44.891+05:30</updated><category term="Tech Guide"/><category term="Tech Gadgets"/><category term="Realme"/><category term="Samsung"/><category term="DCN"/><category term="Xiaomi"/><category term="Asus"/><category term="Dell"/><category term="Motorola"/><category term="OPPO"/><category term="One Plus"/><category term="Vivo"/><category term="Acer"/><category term="Life Talks"/><category term="Lenovo"/><category term="Apple"/><category term="News"/><title type='text'>Tech Hub</title><subtitle type='html'>Check out this blog to know more about Trending Tech Gadgets, Latest Smartphone, Latest Laptops, Computer Graphics, Data communication and Networking and Java.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='https://techfreakforu.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='https://techfreakforu.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Shubhank Shah</name><uri>http://www.blogger.com/profile/14127870435464846441</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmTbp8ZD9aPrsPr-snD4qfX_2SxjEvesdx4MVlpFmGFMF6U0kcCEKDPdKY3e9-TLxDjOor67Lq3IXtH-lC-IYsseQ85OQGVP_J6851CyJdTd-e79qVW4QM1XK8h09eeWo/s124/WhatsApp+Image+2020-06-15+at+1.30.36+PM.jpeg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>129</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5267022146033422138.post-3452777678837245599</id><published>2021-08-13T19:41:00.000+05:30</published><updated>2021-08-13T19:41:49.564+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="DCN"/><title type='text'>Write a Program to Implement Stop and Wait Selective Repeat Using TCP/UDP</title><content type='html'>&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;TCP&lt;/span&gt;&lt;/h1&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;SERVER&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.io.DataInputStream;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.io.DataOutputStream;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.io.IOException;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.net.ServerSocket;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.net.Socket;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.net.SocketException;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;public class Q3_TCPS extends Thread&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; static ServerSocket Serversocket; static DataInputStream dis; static DataOutputStream dos;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; public static void main(String[] args) throws SocketException&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int a[] = { 11, 22, 33, 44, 55, 66, 77, 88 };&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;Server is starting.&quot;); Serversocket = new ServerSocket(9999);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;Server is waiting for client request...&quot;);&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Socket client = Serversocket.accept();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dis = new DataInputStream(client.getInputStream());&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dos = new DataOutputStream(client.getOutputStream());&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;The number of packets sent is:&quot;+a.length);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int y = a.length; dos.write(y);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;No of frame is:&quot; + y);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dos.flush();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (int i = 0; i &amp;lt; a.length; i++)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dos.write(a[i]); Thread.sleep(1000);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;Send frame is: &quot; + a[i]); dos.flush();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int k = dis.read();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Thread.sleep(1000);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;\nRetransmit packet no &quot;+(k+1)+&quot;again!!&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dos.write(a[k]); Thread.sleep(2000);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;\nSend frame is: &quot; + a[k]); Thread.sleep(3000);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;\nAll frame send successfully.&quot;); dos.flush();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catch (Exception e)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;Error is:= &quot;+e); System.exit(0);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; finally&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dis.close();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dos.close();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catch (IOException e)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e.printStackTrace();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Client&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.lang.System;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.net.*;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.io.*;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.util.Random;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;public class Q3_TCPC extends Thread&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; static Socket connection;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; public static void main(String a[]) throws SocketException&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int v[] = new int[10]; int n = 0;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Random rands = new Random(); int rand = 0;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; InetAddress addr = InetAddress.getByName(&quot;Localhost&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; connection = new Socket(addr, 9999);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DataOutputStream out = new DataOutputStream(connection.getOutputStream());&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DataInputStream in = new DataInputStream(connection.getInputStream());&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int p = in.read();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;No of frame is:&quot; + p);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (int i = 0; i &amp;lt; p; i++)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; v[i] = in.read();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //System.out.println(v[i]);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rand = rands.nextInt(p);//FRAME NO. IS RANDOMLY GENERATED&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; v[rand] = -1;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (int i = 0; i &amp;lt; p; i++)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Thread.sleep(1000);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;Received frame is: &quot; + v[i]);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (int i = 0; i &amp;lt; p; i++)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (v[i] == -1)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Thread.sleep(2000); System.out.println(&quot;\nRequest to retransmit from packet no &quot;+ (i+1) + &quot; again!!&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; n = i;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; out.write(n);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; out.flush();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(); v[n] = in.read(); Thread.sleep(3000);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;Received frame is: &quot; + v[n]); Thread.sleep(3000);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;\nAll frame receive successfully.&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catch (Exception e)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;Error is:= &quot;+e); System.exit(0);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;OUTPUT&lt;/span&gt;&lt;/h1&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjn6sshIZ7jGn46gw2bQmjzK_mzar1lRG4JzEvzSmGgdVRZ7h5fMxrlbqStbhQ-t5JX6MwJPCgF5xp_ImieX3UkF9eAqXFlxEfh1XqaCdaIIZ1ujQ1Ku__V_Ebtp9ny81MeJ2smbPsz0vYB/s726/write-a-program-to-implement-stop-and-wait-selective-repeat-using-both-tcp-and-udp.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Write a Program to Implement Stop and Wait Selective Repeat Using TCP/UDP,tcp,udp,dcn&quot; border=&quot;0&quot; data-original-height=&quot;726&quot; data-original-width=&quot;702&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjn6sshIZ7jGn46gw2bQmjzK_mzar1lRG4JzEvzSmGgdVRZ7h5fMxrlbqStbhQ-t5JX6MwJPCgF5xp_ImieX3UkF9eAqXFlxEfh1XqaCdaIIZ1ujQ1Ku__V_Ebtp9ny81MeJ2smbPsz0vYB/w618-h640/write-a-program-to-implement-stop-and-wait-selective-repeat-using-both-tcp-and-udp.jpg&quot; title=&quot;Write a Program to Implement Stop and Wait Selective Repeat Using TCP/UDP&quot; width=&quot;618&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;UDP&lt;/span&gt;&lt;/h1&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;SERVER&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.io.*;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.net.*;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.util.*;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;public class Q3_UDPS extends Thread&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; public static void main(String[] args) throws SocketException&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int a[] = { 11, 22, 33, 44, 55, 66, 77, 88 };&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;Server is starting.&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DatagramSocket ds = new DatagramSocket(9999);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; InetAddress ia = InetAddress.getLocalHost();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;Server is waiting for client request...&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; byte b1[] = new byte[100];&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DatagramPacket dp = new DatagramPacket(b1,b1.length);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ds.receive(dp);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String str = new String(dp.getData());&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; str = str.trim(); System.out.println(&quot;Client &quot;+str);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;The number of packets sent is:&quot; + a.length);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int y = a.length;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; byte b2[] = (String.valueOf(y)).getBytes();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DatagramPacket dp1 = new DatagramPacket(b2,b2.length,ia,dp.getPort());&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ds.send(dp1);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;No of frame is:&quot; + y);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (int i = 0; i &amp;lt; a.length; i++)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; byte b_2[] = (String.valueOf(a[i])).getBytes();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DatagramPacket dp2 = new&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DatagramPacket(b_2,b_2.length,ia,dp.getPort());&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ds.send(dp2); Thread.sleep(1000);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;Send frame is: &quot; + a[i]);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; byte b3[] = new byte[100];&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DatagramPacket dp3 = new DatagramPacket(b3,b3.length);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ds.receive(dp3);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String str2 = new String(dp3.getData()); str2 = str2.trim();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int k = Integer.valueOf(str2);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Thread.sleep(1000);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;\nRetransmit packet no &quot;+(k+1)+&quot;again!!&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; byte b4[] = (String.valueOf(a[k])).getBytes();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DatagramPacket dp4 = new DatagramPacket(b4,b4.length,ia,dp.getPort());&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ds.send(dp4);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Thread.sleep(2000);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;\nSend frame is: &quot; + a[k]);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Thread.sleep(3000);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;\nAll frame send successfully.&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catch (Exception e)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;Error is:= &quot;+e); System.exit(0);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Client&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.lang.System;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.net.*;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.io.*;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.text.*;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.util.Random;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.util.*;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;public class Q3_UDPC extends Thread&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; static Socket connection;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; public static void main(String a[]) throws SocketException&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int v[] = new int[10]; int n = 0;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Random rands = new Random();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int rand = 0;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DatagramSocket ds = new DatagramSocket(); InetAddress ia = InetAddress.getLocalHost();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; byte b1[] = (&quot;Connected.&quot;).getBytes();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DatagramPacket dp = new DatagramPacket(b1,b1.length,ia,9999);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ds.send(dp);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; byte b2[] = new byte[100];&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DatagramPacket dp1 = new DatagramPacket(b2,b2.length); ds.receive(dp1);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String str1 = new String(dp1.getData()); str1 = str1.trim();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int p = Integer.valueOf(str1);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;No of frame is:&quot; + p);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (int i = 0; i &amp;lt; p; i++)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; byte b_2[] = new byte[100]; DatagramPacket dp2 = new&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DatagramPacket(b_2,b_2.length);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ds.receive(dp2);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String str2 = new String(dp2.getData()); str2 = str2.trim();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; v[i] = Integer.valueOf(str2);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rand = rands.nextInt(p);//FRAME NO. IS RANDOMLY v[rand] = -1;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (int i = 0; i &amp;lt; p; i++)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Thread.sleep(1000); System.out.println(&quot;Received frame is: &quot; + v[i]);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (int i = 0; i &amp;lt; p; i++)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (v[i] == -1)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Thread.sleep(2000);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;\nRequest to retransmit from packet no &quot;+ (i+1) + &quot; again!!&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; n = i;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; byte b6[] = (String.valueOf(n)).getBytes();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DatagramPacket dp6 = new DatagramPacket(b6,b6.length,ia,9999);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ds.send(dp6);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; byte b5[] = new byte[100];&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DatagramPacket dp5 = new DatagramPacket(b5,b5.length);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ds.receive(dp5);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String str5 = new String(dp5.getData());&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; str5 = str5.trim();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; v[n] = Integer.valueOf(str5);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Thread.sleep(3000);&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;Received frame is: &quot; + v[n]);&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Thread.sleep(3000);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;\nAll frame receive successfully.&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catch (Exception e)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;Error is:= &quot;+e); System.exit(0);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;OUTPUT&lt;/span&gt;&lt;/h1&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGolfDvyPazBW5egFL3huYkuKIrH1M7mBpavsjniYlPNPBXkZcLUNtFhjxUb9bKEA2SBJ5xqXMcU1CEp51ZsixewpB-MrS5LG5BRvZeeGOYtT_VPyuZ65A6mTb4knLe_O8vKn1O1h3olwc/s698/write-a-program-to-implement-stop-and-wait-selective-repeat-using-both-tcp-and-udp-dcn.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Write a Program to Implement Stop and Wait Selective Repeat Using TCP/UDP,tcp,udp,dcn,java&quot; border=&quot;0&quot; data-original-height=&quot;576&quot; data-original-width=&quot;698&quot; height=&quot;528&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGolfDvyPazBW5egFL3huYkuKIrH1M7mBpavsjniYlPNPBXkZcLUNtFhjxUb9bKEA2SBJ5xqXMcU1CEp51ZsixewpB-MrS5LG5BRvZeeGOYtT_VPyuZ65A6mTb4knLe_O8vKn1O1h3olwc/w640-h528/write-a-program-to-implement-stop-and-wait-selective-repeat-using-both-tcp-and-udp-dcn.jpg&quot; title=&quot;Write a Program to Implement Stop and Wait Selective Repeat Using TCP/UDP&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2021/08/why-minimally-invasive-spine-surgery-is-beneficial.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;Why minimally invasive spine surgery is beneficial&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;Comment your views on this Article :)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2 style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;Thank you for visiting my blog :)&lt;/span&gt;&lt;/h2&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://techfreakforu.blogspot.com/feeds/3452777678837245599/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://techfreakforu.blogspot.com/2021/08/write-a-program-to-implement-stop-and-wait-selective-repeat-using-both-tcp-and-udp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/3452777678837245599'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/3452777678837245599'/><link rel='alternate' type='text/html' href='https://techfreakforu.blogspot.com/2021/08/write-a-program-to-implement-stop-and-wait-selective-repeat-using-both-tcp-and-udp.html' title='Write a Program to Implement Stop and Wait Selective Repeat Using TCP/UDP'/><author><name>Shubhank Shah</name><uri>http://www.blogger.com/profile/14127870435464846441</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmTbp8ZD9aPrsPr-snD4qfX_2SxjEvesdx4MVlpFmGFMF6U0kcCEKDPdKY3e9-TLxDjOor67Lq3IXtH-lC-IYsseQ85OQGVP_J6851CyJdTd-e79qVW4QM1XK8h09eeWo/s124/WhatsApp+Image+2020-06-15+at+1.30.36+PM.jpeg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjn6sshIZ7jGn46gw2bQmjzK_mzar1lRG4JzEvzSmGgdVRZ7h5fMxrlbqStbhQ-t5JX6MwJPCgF5xp_ImieX3UkF9eAqXFlxEfh1XqaCdaIIZ1ujQ1Ku__V_Ebtp9ny81MeJ2smbPsz0vYB/s72-w618-h640-c/write-a-program-to-implement-stop-and-wait-selective-repeat-using-both-tcp-and-udp.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5267022146033422138.post-6815733144548517797</id><published>2021-08-12T10:57:00.001+05:30</published><updated>2021-08-13T19:42:53.469+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Life Talks"/><title type='text'>Why Minimally Invasive Spine Surgery is Beneficial?</title><content type='html'>&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Understand the term &quot;Minimally Invasive Spine Surgery&quot;&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;/p&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhutHq2fa9KQ1SlTiQWxjazmB-v03pxgnv_ctUa2fRAeAWgts53iFX4cGcty8xIUSWF6yruLZqQw89Cf5ZWbMxGVKcb_Ou1tvTeydgMjtHQCNnfP2BjdteWpp5UopfAqy5usX3WPWyG2sCz/s716/why-minimally-invasive-spine-surgery-is-beneficial.jpg&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Why Minimally Invasive Spine Surgery is Beneficial,spine surgery&quot; border=&quot;0&quot; data-original-height=&quot;716&quot; data-original-width=&quot;716&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhutHq2fa9KQ1SlTiQWxjazmB-v03pxgnv_ctUa2fRAeAWgts53iFX4cGcty8xIUSWF6yruLZqQw89Cf5ZWbMxGVKcb_Ou1tvTeydgMjtHQCNnfP2BjdteWpp5UopfAqy5usX3WPWyG2sCz/w640-h640/why-minimally-invasive-spine-surgery-is-beneficial.jpg&quot; title=&quot;Why Minimally Invasive Spine Surgery is Beneficial?&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt;Image Source - Google | Image Credit -&amp;nbsp;&lt;a href=&quot;https://www.painguru.in/index.php/services/minimal-invasive-spine-surgery&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;painguru&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;In recent times, technology has developed in such a way that medical surgeries are becoming more successful as compared to past times.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Even, with the help of technology, surgical machines are run on an AI base and it will occur minimal pain to the patient while doing the heavy operation on him/her.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Spine surgery is considered as &quot;Open Surgery&quot; on the patient. A doctor can view the damaged part of the spine easily while doing this spinal operation.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;As this spinal surgery is done &quot;inside the body&quot;, minimum pain will occur as compared to &quot;outer body&quot; operation.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;With the advancement of technology, even patients didn&#39;t feel much pain while surgery because surgeons give them anesthesia. But, after the surgery little pain will be felt by patients because of the less impact of anesthesia on their respective body part.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;After the successful minimally invasive spine surgery, some physical therapy is given to patients to cure their spinal part very quickly and in an efficient way.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;To attempt this surgery, most of the surgeons use &quot;tabular retractor&quot; technique. In which, one cut is made and a tabular retractor is inserted inside the skin which creates one little tunnel to the particular area where the problem exists.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Throughout the procedure, any little bone is removed with the help of a retractor and in the replacement of the bone, any screw or rod is inserted through the tubular retractor and fit on the problematic area of the spine.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Surgeons can see real-time x-ray images of patients while attempting real-time operations.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Most of the time 2 types of anesthesia are given to patients:&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;1) Asleep throughout the whole operation.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;2) Awake but no feeling in the spine area.&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Benefits of Minimal Invasive Spine Surgery&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAKKjdqdYRhLnoQmD5GIMUgibOzg_9RjkTSdt7b3Jmo5IgzlzLKhxdYbkRzoq-i75XUtisQa4hrcaH8FKf7MvWUg9jxt4Y01qn7Gd3DsfS_FH41vrELxrDyis7e3sVnSxBgZDmmBpdMYvg/s620/why-minimally-invasive-spine-surgery-is-beneficial-hd.jpg&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Why Minimally Invasive Spine Surgery is Beneficial,spine,surgery,spine surgery&quot; border=&quot;0&quot; data-original-height=&quot;408&quot; data-original-width=&quot;620&quot; height=&quot;422&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAKKjdqdYRhLnoQmD5GIMUgibOzg_9RjkTSdt7b3Jmo5IgzlzLKhxdYbkRzoq-i75XUtisQa4hrcaH8FKf7MvWUg9jxt4Y01qn7Gd3DsfS_FH41vrELxrDyis7e3sVnSxBgZDmmBpdMYvg/w640-h422/why-minimally-invasive-spine-surgery-is-beneficial-hd.jpg&quot; title=&quot;Why Minimally Invasive Spine Surgery is Beneficial?&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt;Image Source - Google | Image Credit -&amp;nbsp;&lt;a href=&quot;https://www.pennmedicine.org/updates/blogs/neuroscience-blog/2020/july/types-of-spine-surgery&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;pennmedicine&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;&lt;span style=&quot;color: #0b5394; font-family: helvetica;&quot;&gt;Less blood loss:&lt;/span&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt; As in this spinal surgery, a small incision is made, smaller amount of blood will lose during this operation.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;Smaller amount of anesthesia:&lt;/span&gt; nowadays, the medical sector is developed in such a way that patients can see their operation &quot;live&quot; with the help of an advanced level of anesthesia with a lower amount of it.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;No scarring:&lt;/span&gt; As anesthesia is given to patients, they will feel 0% in the spine area where their operation is conducted and it will lead to no scar or fear to the patient.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;Fast recovery:&lt;/span&gt; Upgradation to medical instruments and techniques, operations are becoming safer and faster recoverable for the patients.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;Small cuts:&lt;/span&gt; Incision for spinal surgery will be very small as it is needed for the insertion of retractor.&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Note&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;As spine surgery is done inside the body, there might be a risk of blood clots, infections, chances of paralysis, pain and discomfort on the operational area and chances of allergic reactions after(post) the operation.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Such types of risks are only associated when you did minimally invasive spine surgery with not more experienced surgeon.&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2021/08/the-advantages-of-perfect-landing-page-for-better-roi.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;The advantages of perfect landing page for better ROI&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2021/08/write-a-program-to-implement-stop-and-wait-selective-repeat-using-both-tcp-and-udp.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;Stop and wait selective repeat using tcp and udp&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;Comment your views on this Article :)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2 style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;Thank you for visiting my blog :)&lt;/span&gt;&lt;/h2&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://techfreakforu.blogspot.com/feeds/6815733144548517797/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://techfreakforu.blogspot.com/2021/08/why-minimally-invasive-spine-surgery-is-beneficial.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/6815733144548517797'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/6815733144548517797'/><link rel='alternate' type='text/html' href='https://techfreakforu.blogspot.com/2021/08/why-minimally-invasive-spine-surgery-is-beneficial.html' title='Why Minimally Invasive Spine Surgery is Beneficial?'/><author><name>Shubhank Shah</name><uri>http://www.blogger.com/profile/14127870435464846441</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmTbp8ZD9aPrsPr-snD4qfX_2SxjEvesdx4MVlpFmGFMF6U0kcCEKDPdKY3e9-TLxDjOor67Lq3IXtH-lC-IYsseQ85OQGVP_J6851CyJdTd-e79qVW4QM1XK8h09eeWo/s124/WhatsApp+Image+2020-06-15+at+1.30.36+PM.jpeg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhutHq2fa9KQ1SlTiQWxjazmB-v03pxgnv_ctUa2fRAeAWgts53iFX4cGcty8xIUSWF6yruLZqQw89Cf5ZWbMxGVKcb_Ou1tvTeydgMjtHQCNnfP2BjdteWpp5UopfAqy5usX3WPWyG2sCz/s72-w640-h640-c/why-minimally-invasive-spine-surgery-is-beneficial.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5267022146033422138.post-4652247668136491932</id><published>2021-08-11T19:25:00.001+05:30</published><updated>2021-08-12T10:58:29.587+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Tech Guide"/><title type='text'>The Advantages of Perfect Landing Page For Better ROI</title><content type='html'>&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;What is landing page ??&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;/p&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEie5iSFO_R5aOzGxLx0VOhe9gj5MrvHPc6I3egaLNp0GL7IPzYflE039jxEADJvn0HNmVSR5oxz-GsjyPlQqh5a_jI7cioZ6dwJybkZ9NPIlVzPJWzjJciTCtqz0z9rfCFFZwnX0va2yCcs/s600/the-advantages-of-perfect-landing-page-for-better-roi.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;the advantages of perfect landing page for better roi,blogger,blog tips,perfect blog tips&quot; border=&quot;0&quot; data-original-height=&quot;403&quot; data-original-width=&quot;600&quot; height=&quot;430&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEie5iSFO_R5aOzGxLx0VOhe9gj5MrvHPc6I3egaLNp0GL7IPzYflE039jxEADJvn0HNmVSR5oxz-GsjyPlQqh5a_jI7cioZ6dwJybkZ9NPIlVzPJWzjJciTCtqz0z9rfCFFZwnX0va2yCcs/w640-h430/the-advantages-of-perfect-landing-page-for-better-roi.png&quot; title=&quot;The Advantages of Perfect Landing Page For Better ROI&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt;Image Source - Google | Image Credit -&amp;nbsp;&lt;a href=&quot;https://digitalpublishing101.com/digital-marketing-101/digital-marketing-toolbox/part-3-email-and-online-advertising/landing-pages/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;digitalpublishing101&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Have you ever heard the word &quot;Landing Page&quot; before? Well, I think you saw it in your routine life but majority of time you don&#39;t know about this term. So let&#39;s discuss it.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Landing page is a web page which looks very attractive and easily navigational for any user.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;Navigation:&lt;/span&gt; The navigation bar can help you to reach out to any of the web pages of a particular website within seconds, so it can save your time.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;Image that supports topic:&lt;/span&gt; Most of the time you click on any web page by seeing its picture... Am i right ?? Yes !!!&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;Share links:&lt;/span&gt; You must have to put links of your other articles in your current article to promote them and which will helpful for you to get a better reach through your blog reader.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;Bullet Points:&lt;/span&gt; It is advisable to add bullet points in the starting of your article, so that user can decide if he or she has to read your article or not and also it will save your users time.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;Shorter Forms:&lt;/span&gt; Any blogger must have to add little form or newsletter form in their article, so that they can directly receive mails regarding your latest post in your blog.&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;How landing page works ??&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTTL4cfbOQoBk22f-845m5EEprz7jyDUwDBza_ml38PbuFr12f31NFDR-2PE9r5yx9iseTPP2r3VLwBHnNQBX7_qJiHXeZSjDMC9_k4VPceofdH529hjEP7P0Q4G2YOZGM_rNk1qAeisNj/s650/the-advantages-of-perfect-landing-page-for-better-roi-blogging-tips.jpg&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;the advantages of perfect landing page for better roi,blogger,blog tips,perfect blog tips&quot; border=&quot;0&quot; data-original-height=&quot;400&quot; data-original-width=&quot;650&quot; height=&quot;394&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTTL4cfbOQoBk22f-845m5EEprz7jyDUwDBza_ml38PbuFr12f31NFDR-2PE9r5yx9iseTPP2r3VLwBHnNQBX7_qJiHXeZSjDMC9_k4VPceofdH529hjEP7P0Q4G2YOZGM_rNk1qAeisNj/w640-h394/the-advantages-of-perfect-landing-page-for-better-roi-blogging-tips.jpg&quot; title=&quot;The Advantages of Perfect Landing Page For Better ROI&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt;Image Source - Google | Image Credit - &lt;a href=&quot;https://www.ndtv.com/business/zomatos-share-zooms-post-poor-results-should-you-buy-or-sell-read-what-brokerages-say-2507791&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;ndtv&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;In sweet and simple language, a landing page can customize the need of users in shorter steps and in a quick way.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #351c75; font-family: helvetica; font-size: x-large;&quot;&gt;Example of Zomato&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;Step 1:&lt;/span&gt; If you want to order anything from zomato then first of all will signup or login to their system and then you will set your location.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;Step 2:&lt;/span&gt; You will search for any food item (Pizza) and search... Then their algorithm will show you only those restaurants or pizza shops that are nearby your set location.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;Step 3:&lt;/span&gt; You will choose your favorite pizza shop or restaurant and then you will select your favorite pizza and will select the quantity.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;Step 4:&lt;/span&gt; In this step, you will choose online payment or offline payment.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;Step 5:&lt;/span&gt; Finalize your order and pay regarding your mode of payment.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;So, this whole process completes in a very smooth and smarter way. In the future, you will surely like to visit websites like zomato which completes your need very faster and smoothly without any disturbance.&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Pros of better ROI with the help of landing page&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDJYz06sBjrO7KeiU_0Vh0Sv_Q-w4DWaRU4BATJGMVlrVQYCm7NoxKct6YdflYoj5itZ1921WNznZF-92pfF0wPN0uYjmThMGUPZrEczx5hb5vBaXUUaUCvNV_XZhU0O6lndCLDaeaRriG/s762/the-advantages-of-perfect-landing-page-for-better-roi-blogger.jpg&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;the advantages of perfect landing page for better roi,blogger,blog tips,perfect blog tips&quot; border=&quot;0&quot; data-original-height=&quot;465&quot; data-original-width=&quot;762&quot; height=&quot;390&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDJYz06sBjrO7KeiU_0Vh0Sv_Q-w4DWaRU4BATJGMVlrVQYCm7NoxKct6YdflYoj5itZ1921WNznZF-92pfF0wPN0uYjmThMGUPZrEczx5hb5vBaXUUaUCvNV_XZhU0O6lndCLDaeaRriG/w640-h390/the-advantages-of-perfect-landing-page-for-better-roi-blogger.jpg&quot; title=&quot;The Advantages of Perfect Landing Page For Better ROI&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Image Source - Google | Image Credit -&amp;nbsp;&lt;a href=&quot;https://www.wordstream.com/blog/ws/2019/09/12/startup-landing-page&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;wordstream&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;&lt;span style=&quot;color: #0b5394; font-family: helvetica;&quot;&gt;High Revenue:&lt;/span&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt; It is obvious that if your website&#39;s UI is better then any user will like to visit again and again which will lead to high income with the help of Google Adsense or any other ad provider.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;Increase your business goals:&lt;/span&gt; If any user likes your website then he or she will talk about your site with another person. So, indirectly it will rise up your site&#39;s marketing goals and lead to an increase in your site traffic.&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;Increase search traffic:&lt;/span&gt; If more people visit your site then it will directly impact on site&#39;s ranking and there might be a possibility of getting the rank on the first web page of your site&#39;s keyword.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2021/08/food-habits-and-monsoon.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;Know more about food habits and monsoon&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2021/08/why-minimally-invasive-spine-surgery-is-beneficial.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;Why minimally invasive spine surgery is beneficial?&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;Comment your views on this Article :)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2 style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;Thank you for visiting my blog :)&lt;/span&gt;&lt;/h2&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://techfreakforu.blogspot.com/feeds/4652247668136491932/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://techfreakforu.blogspot.com/2021/08/the-advantages-of-perfect-landing-page-for-better-roi.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/4652247668136491932'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/4652247668136491932'/><link rel='alternate' type='text/html' href='https://techfreakforu.blogspot.com/2021/08/the-advantages-of-perfect-landing-page-for-better-roi.html' title='The Advantages of Perfect Landing Page For Better ROI'/><author><name>Shubhank Shah</name><uri>http://www.blogger.com/profile/14127870435464846441</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmTbp8ZD9aPrsPr-snD4qfX_2SxjEvesdx4MVlpFmGFMF6U0kcCEKDPdKY3e9-TLxDjOor67Lq3IXtH-lC-IYsseQ85OQGVP_J6851CyJdTd-e79qVW4QM1XK8h09eeWo/s124/WhatsApp+Image+2020-06-15+at+1.30.36+PM.jpeg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEie5iSFO_R5aOzGxLx0VOhe9gj5MrvHPc6I3egaLNp0GL7IPzYflE039jxEADJvn0HNmVSR5oxz-GsjyPlQqh5a_jI7cioZ6dwJybkZ9NPIlVzPJWzjJciTCtqz0z9rfCFFZwnX0va2yCcs/s72-w640-h430-c/the-advantages-of-perfect-landing-page-for-better-roi.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5267022146033422138.post-7982139743133718157</id><published>2021-08-11T15:46:00.003+05:30</published><updated>2021-08-11T19:26:39.897+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Life Talks"/><title type='text'>Food Habits and Monsoon</title><content type='html'>&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Fritters&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;/p&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEiY0EtuAKGMCO_yxSmwL-vZJSdifg4UvZgyrDQr_SCTMx1Ti8ZaK41bKRRKYGfYzSBosTsaJ645lgBnVR54Wz3-aiWzI0QLSgNfuh_JmO0SvMV4sKwZxBPxEGlIZQ1xNM9Yfw7NNDdi4R/s1280/food-habits-and-monsoon.jpg&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;food habits and monsoon,fritters&quot; border=&quot;0&quot; data-original-height=&quot;720&quot; data-original-width=&quot;1280&quot; height=&quot;360&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEiY0EtuAKGMCO_yxSmwL-vZJSdifg4UvZgyrDQr_SCTMx1Ti8ZaK41bKRRKYGfYzSBosTsaJ645lgBnVR54Wz3-aiWzI0QLSgNfuh_JmO0SvMV4sKwZxBPxEGlIZQ1xNM9Yfw7NNDdi4R/w640-h360/food-habits-and-monsoon.jpg&quot; title=&quot;Food Habits and Monsoon&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt;Image Source - Google | Image Credit -&amp;nbsp;&lt;a href=&quot;https://www.nehascookbook.com/corn-pakoda-with-green-chutney-recipe-makai-na-bhajiya-rajkot-famous-green-chutney/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;nehascookbook&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Well, are you a foodie? I guess, Yes!! That&#39;s why you are here... Then you are at the perfect place.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;There are total 4 seasons (Winter, Spring, Summer, and Monsoon) in our country, but Monsoon is something special rainy season&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;when our food habits get changed drastically as compared to the rest of the 3 seasons.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;When the rain starts, most of the people thought to eat fritters (पकोड़े) by enjoying the rainy atmosphere along with the earthy aroma.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Even my favourite season is Monsoon and when rain is there, I used to tell my mom that &quot;Mom, please make only fritters for me today, I am not gonna eat anything else&quot;.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Fritters are the most common eatable food which majority of people like to eat because it feels energetic and can help for the relaxation of our mind by having hot foods during the rainy atmosphere.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Though, fritters are not healthy food at all as it is a fried item, it is acceptable to take it during the monsoon for the refreshment of your soul.&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Soup&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;/p&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtffqMO56m1IHyIXJjINkNQn4kdmaEJvp1XzNLtUInjDP7A14H4zzT55M6R0VbayzFbwMdroUCAZLqaFrKOyAZlwMp8KbvhHLgbg4OVR6HhTYVeYSxnpE9QklBrOVtR3tKRr5BcRmajT5o/s680/food-habits-and-monsoon-soup.jpg&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;food habits and monsoon,soup&quot; border=&quot;0&quot; data-original-height=&quot;510&quot; data-original-width=&quot;680&quot; height=&quot;480&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtffqMO56m1IHyIXJjINkNQn4kdmaEJvp1XzNLtUInjDP7A14H4zzT55M6R0VbayzFbwMdroUCAZLqaFrKOyAZlwMp8KbvhHLgbg4OVR6HhTYVeYSxnpE9QklBrOVtR3tKRr5BcRmajT5o/w640-h480/food-habits-and-monsoon-soup.jpg&quot; title=&quot;Food Habits and Monsoon&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt;Image Source - Google | Image Credit -&amp;nbsp;&lt;a href=&quot;https://www.indianhealthyrecipes.com/vegetable-soup/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;indianhealthyrecipes&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt;In our country, there are different types of soups are available, like tomato soup, baby corn soup, hot and sour soup, manchow soup&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt;and many more are available in the market.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;As I said, in monsoon little bit of cold weather is there, drinking soup with toast can help any person to give warmth while enjoying the rain with your loved ones.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;One of the major benefit of taking a sip of soup with toast is that it is a healthy beverage and it will always be helpful for the betterment of your heart.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Around one month ago, I went to one hilly area and I was sitting outside one local eatery shop. There was immediately raining started and my friends gave the order of fritters (पकोड़े), but I chose to give an order of Tomato Soup over fritters and I will never forget that experience in my whole life.&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Fruits&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;/p&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEich1QFYZIlax3Bp9E1ZT8fKlkaOxoHzp9BBmOnWn5am4J1nq6A8AVVLXYIDLeUGibrSCKEyYVpppm7LOFLIjepocoWVUCysjK34waNaZ8v5MH7vdguvrNSMbEkUJI0IfT2V84GI0jSRqE0/s2048/food-habits-and-monsoon-fruits.jpg&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;food habits and monsoon,fruits&quot; border=&quot;0&quot; data-original-height=&quot;1367&quot; data-original-width=&quot;2048&quot; height=&quot;428&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEich1QFYZIlax3Bp9E1ZT8fKlkaOxoHzp9BBmOnWn5am4J1nq6A8AVVLXYIDLeUGibrSCKEyYVpppm7LOFLIjepocoWVUCysjK34waNaZ8v5MH7vdguvrNSMbEkUJI0IfT2V84GI0jSRqE0/w640-h428/food-habits-and-monsoon-fruits.jpg&quot; title=&quot;Food Habits and Monsoon&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt;Image Source - Google | Image Credit -&amp;nbsp;&lt;a href=&quot;https://www.goodhousekeeping.com/health/diet-nutrition/g28511617/healthiest-fruits/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;goodhousekeeping&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Fruits are evergreen eatable items that will never harm your body system in any aspect.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;During monsoon, taking fruits like apples, cherries, papayas and lichi will helpful to you for better digestion of your immune system.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;in monsoon time, If any children don&#39;t like soup or fritter, then I think no children can deny fruits because at these early age fruits are their favourite food item to eat.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Basically, fruits are very light food items, which can easily digest during foggy weather in the monsoon season.&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Maggie&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;/p&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi23Q-BTKtvPpsQD5Tp9lQWU2KcP_Oy94pB-ryaJ85uIBKzXASIjVvJkRMjFjgWBzaWbBCBMVyqoA9eRW9hBe4M975njmQvFow2FXa-WtxOwvHgzhKSQZo6z1L1CRhVsECf-gbfgwCyRXOC/s1280/food-habits-and-monsoon-maggie.jpg&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;food habits and monsoon,maggie&quot; border=&quot;0&quot; data-original-height=&quot;720&quot; data-original-width=&quot;1280&quot; height=&quot;360&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi23Q-BTKtvPpsQD5Tp9lQWU2KcP_Oy94pB-ryaJ85uIBKzXASIjVvJkRMjFjgWBzaWbBCBMVyqoA9eRW9hBe4M975njmQvFow2FXa-WtxOwvHgzhKSQZo6z1L1CRhVsECf-gbfgwCyRXOC/w640-h360/food-habits-and-monsoon-maggie.jpg&quot; title=&quot;Food Habits and Monsoon&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt;Image Source - Google | Image Credit - &lt;a href=&quot;https://www.youtube.com/watch?v=6GGSOVIlhHs&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;youtube&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Rain is useless if you don&#39;t eat maggie when you were a child.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;The majority of children like to have maggie while seeing raining outside their home. Even nowadays parents like to eat it to give a company to their children in monsoon season.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;The trend of eating maggie came from North India and recently it is followed by all parts of India.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;I hope all of your mouths get watery while reading this delicious article.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2021/08/write-a-program-to-implement-stop-and-wait-arq-protocol-using-both-tcp-and-udp.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;Know more about Stop and Wait ARQ protocol using both TCP and UDP&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2021/08/the-advantages-of-perfect-landing-page-for-better-roi.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;Know more about the advantages of perfect landing page for better ROI&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;Comment your views on this Article :)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2 style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;Thank you for visiting my blog :)&lt;/span&gt;&lt;/h2&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://techfreakforu.blogspot.com/feeds/7982139743133718157/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://techfreakforu.blogspot.com/2021/08/food-habits-and-monsoon.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/7982139743133718157'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/7982139743133718157'/><link rel='alternate' type='text/html' href='https://techfreakforu.blogspot.com/2021/08/food-habits-and-monsoon.html' title='Food Habits and Monsoon'/><author><name>Shubhank Shah</name><uri>http://www.blogger.com/profile/14127870435464846441</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmTbp8ZD9aPrsPr-snD4qfX_2SxjEvesdx4MVlpFmGFMF6U0kcCEKDPdKY3e9-TLxDjOor67Lq3IXtH-lC-IYsseQ85OQGVP_J6851CyJdTd-e79qVW4QM1XK8h09eeWo/s124/WhatsApp+Image+2020-06-15+at+1.30.36+PM.jpeg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEiY0EtuAKGMCO_yxSmwL-vZJSdifg4UvZgyrDQr_SCTMx1Ti8ZaK41bKRRKYGfYzSBosTsaJ645lgBnVR54Wz3-aiWzI0QLSgNfuh_JmO0SvMV4sKwZxBPxEGlIZQ1xNM9Yfw7NNDdi4R/s72-w640-h360-c/food-habits-and-monsoon.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5267022146033422138.post-3560403542273069575</id><published>2021-08-09T21:47:00.001+05:30</published><updated>2021-08-11T15:46:50.926+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="DCN"/><title type='text'>Write a program to implement Stop and Wait ARQ protocol using both TCP and UDP</title><content type='html'>&lt;h1 style=&quot;text-align: left;&quot;&gt;&amp;nbsp;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;TCP&lt;/span&gt;&lt;/h1&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Client Side:&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.io.*;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.net.*;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;public class A5_C_TCP&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Socket sender;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;ObjectOutputStream out;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;ObjectInputStream in;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;String packet,ack,str, msg;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;int n,i=0,sequence=0;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;public void run()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;try&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;BufferedReader br=new BufferedReader(new&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;InputStreamReader(System.in));&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;Waiting for Connection... &quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;sender = new Socket(&quot;localhost&quot;,2004);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;sequence=0;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;out=new&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;ObjectOutputStream(sender.getOutputStream());&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;out.flush();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;in=new ObjectInputStream(sender.getInputStream());&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;str=(String)in.readObject();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;Client &quot;+str);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.print(&quot;Enter the data to send:= &quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;packet=br.readLine();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;\nPacket is:= &quot;+packet);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;n=packet.length();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;// System.out.println(&quot;N is:= &quot;+n);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;do&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;try&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;if(i&amp;lt;n)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Substring msg is:= &quot;+msg);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;msg=String.valueOf(sequence);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;// System.out.println(&quot;Before&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;msg=msg.concat(packet.substring(i,i+1));&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;// System.out.println(&quot;After&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Substring msg is:= &quot;+msg);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;else if(i==n)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;msg=&quot;end&quot;;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;out.writeObject(msg);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;break;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&quot;+sequence);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;is:= &quot;+ack);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;out.writeObject(msg);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;sequence=(sequence==0)?1:0;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;// System.out.println(&quot;sequence is:=&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;out.flush();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;data sent := &quot;+msg);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Thread.sleep(2000);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;ack=(String)in.readObject();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;// System.out.println(&quot;acknowledgment&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;waiting for&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;acknowledgment...&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;if(ack.equals(String.valueOf(sequence)))&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;recieved\n&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;i++;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;Packet&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;else&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Thread.sleep(2000);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;resending data...\n&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;Time out&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;sequence=(sequence==0)?1:0;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Thread.sleep(2000);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;catch(Exception e)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.exit(0);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}while(i&amp;lt;n+1);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;\nAll data sent.&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;catch(Exception e)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.exit(0);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;finally&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;try&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;in.close();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;out.close();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;sender.close();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;catch(Exception e){}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;public static void main(String args[])&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;A5_C_TCP obj = new A5_C_TCP();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;obj.run();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Server Side:&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.io.*;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.net.*;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;public class A5_S_TCP&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;ServerSocket Receiver;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Socket connection=null;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;ObjectOutputStream out;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;ObjectInputStream in;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;String packet,ack,data=&quot;&quot;;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;int i=0,sequence=0;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;public void run()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;try&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;BufferedReader br=new BufferedReader(new&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;InputStreamReader(System.in));&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;Server is starting.&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Receiver = new ServerSocket(2004,10);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;Server is waiting for client&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;request...&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;connection=Receiver.accept();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;sequence=0;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;Connection established.&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;out=new&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;ObjectOutputStream(connection.getOutputStream());&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;out.flush();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;in=new&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;ObjectInputStream(connection.getInputStream());&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;out.writeObject(&quot;connected.&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;do&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;try&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&quot;+packet);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;packet=(String)in.readObject();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;Packet is:=&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;if(packet.equals(&quot;end&quot;))&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;recived is:= &quot;+data);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;\nData&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;String temp = data;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;data = temp.replace(data, &quot; &quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;// System.out.println(&quot;sequence is:=&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&quot;+sequence);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;if(Integer.valueOf(packet.substring(0,1))==sequence)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&quot;+data);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;is:= &quot;+sequence);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;packet is:= &quot;+packet);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;data+=packet.substring(1);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;data is:=&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;sequence=(sequence==0)?1:0;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;// System.out.println(&quot;sequence&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;\nReceive&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Thread.sleep(2000);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;else&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;\nReceive&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;packet is:= &quot;+packet+&quot; with duplicate data&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Thread.sleep(2000);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;if(i&amp;lt;3)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(String.valueOf(sequence));&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;out.writeObject(String.valueOf(sequence));i++;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;Acknowledgment sended.&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Thread.sleep(2000);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;else&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;String.valueOf(String.valueOf((sequence+1)%2));&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;out.writeObject(String.valueOf((sequence+1)%2));&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;i=0;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;Acknowledgment sended.&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Thread.sleep(2000);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;catch(Exception e)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.exit(0);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}while(!packet.equals(&quot;end&quot;));&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;out.writeObject(&quot;\nconnection ended.&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;catch(Exception e)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;finally&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;try&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;in.close();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;out.close();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Receiver.close();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;catch(Exception e)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.exit(0);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;public static void main(String args[])&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;A5_S_TCP obj = new A5_S_TCP();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;obj.run();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Output:&lt;/span&gt;&lt;/h1&gt;&lt;div&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2Iav_10iRPYst77RfzTmrW_zpniPB4ycddBtappc7vFTrFggKfWJmx5oMRGvt_Jr0wXpau6d6lXIhQ4WCuTU_fvXE7SlU71Lwx8e3vCd9R2kOiKzrhCpqN_5Job8TTO6zHrzBDM1a8DT0/s763/write-a-program-to-implement-stop-and-wait-arq-protocol-using-both-tcp-and-udp-dcn.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Write a program to implement Stop and Wait ARQ protocol using both TCP and UDP&quot; border=&quot;0&quot; data-original-height=&quot;516&quot; data-original-width=&quot;763&quot; height=&quot;432&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2Iav_10iRPYst77RfzTmrW_zpniPB4ycddBtappc7vFTrFggKfWJmx5oMRGvt_Jr0wXpau6d6lXIhQ4WCuTU_fvXE7SlU71Lwx8e3vCd9R2kOiKzrhCpqN_5Job8TTO6zHrzBDM1a8DT0/w640-h432/write-a-program-to-implement-stop-and-wait-arq-protocol-using-both-tcp-and-udp-dcn.png&quot; title=&quot;Write a program to implement Stop and Wait ARQ protocol using both TCP and UDP&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiv-xqrhI49HTkumEtBWZ0d3yODWmissaOrQlczgzCJ0wbplk9GOSySKutRfQOv0mZ9PT3mN0dR-_EKMuORg5VXb_S_1TFeHGFV5n-ABxu6MNEWWEzhMuomU_nJ3Xpil6UCElCh4cflhZgD/s715/write-a-program-to-implement-stop-and-wait-arq-protocol-using-both-tcp-and-udp.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Write a program to implement Stop and Wait ARQ protocol using both TCP and UDP&quot; border=&quot;0&quot; data-original-height=&quot;574&quot; data-original-width=&quot;715&quot; height=&quot;514&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiv-xqrhI49HTkumEtBWZ0d3yODWmissaOrQlczgzCJ0wbplk9GOSySKutRfQOv0mZ9PT3mN0dR-_EKMuORg5VXb_S_1TFeHGFV5n-ABxu6MNEWWEzhMuomU_nJ3Xpil6UCElCh4cflhZgD/w640-h514/write-a-program-to-implement-stop-and-wait-arq-protocol-using-both-tcp-and-udp.png&quot; title=&quot;Write a program to implement Stop and Wait ARQ protocol using both TCP and UDP&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;UDP&lt;/span&gt;&lt;/h1&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Client Side:&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.io.*;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.net.*;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.util.*;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;public class A5_C_UDP extends Thread&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;String packet,ack,str, msg;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;int n,i=0,sequence=0;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;public void run()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;try&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Scanner scan = new Scanner(System.in);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;DatagramSocket ds = new DatagramSocket();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;InetAddress ia = InetAddress.getLocalHost();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;sequence=0;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;byte b1[] = (&quot;Connected.&quot;).getBytes();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;DatagramPacket dp = new&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;DatagramPacket(b1,b1.length,ia,9999);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;ds.send(dp);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;Server Connected.&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.print(&quot;Enter the data to send:= &quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;packet=scan.nextLine();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;\nPacket is:= &quot;+packet);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;packet = packet.replace(&quot; &quot;,&quot;&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;n=packet.length();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;N is:= &quot;+n);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;do&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;try&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;if(i&amp;lt;n)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;msg=String.valueOf(sequence);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;// System.out.println(&quot;Before&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Substring msg is:= &quot;+msg);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;msg=msg.concat(packet.substring(i,i+1));&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;// System.out.println(&quot;After&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Substring msg is:= &quot;+msg);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;else if(i==n)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;(String.valueOf(msg)).getBytes();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;msg=&quot;end&quot;;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;byte b4[] =&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;DatagramPacket dp4 = new&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;DatagramPacket(b4,b4.length,ia,dp.getPort());&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;ds.send(dp4);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;break;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;(String.valueOf(msg)).getBytes();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;byte b3[] =&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;DatagramPacket dp3 = new&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;DatagramPacket(b3,b3.length,ia,dp.getPort());&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;ds.send(dp3);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;sequence=(sequence==0)?1:0;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;// System.out.println(&quot;sequence is:=&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&quot;+sequence);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;data sent := &quot;+msg);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Thread.sleep(2000);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;DatagramPacket(b5,b5.length);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;is:= &quot;+ack);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;byte b5[] = new byte[100];&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;DatagramPacket dp5 = new&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;ds.receive(dp5);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;String str5 = new String(dp5.getData());&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;ack = str5.trim();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;// System.out.println(&quot;acknowledgment&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;waiting for&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;acknowledgment...&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;if(ack.equals(String.valueOf(sequence)))&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;recieved\n&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;i++;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;Packet&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Thread.sleep(2000);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;resending data...\n&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;else&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;Time out&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;sequence=(sequence==0)?1:0;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Thread.sleep(2000);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;catch(Exception e)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.exit(0);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}while(i&amp;lt;n+1);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;\nAll data sent.&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;catch(Exception e)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.exit(0);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;public static void main(String args[])&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;A5_C_UDP obj = new A5_C_UDP();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;obj.start();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Server Side:&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.io.*;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.net.*;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;public class A5_S_UDP extends Thread&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;ServerSocket Receiver;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Socket connection=null;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;ObjectOutputStream out;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;ObjectInputStream in;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;String packet,ack,data=&quot;&quot;;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;int i=0,sequence=0;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;public void run()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;try&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;request...&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;Server is starting.&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;DatagramSocket ds = new DatagramSocket(9999);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;InetAddress ia = InetAddress.getLocalHost();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;Server is waiting for client&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;byte b1[] = new byte[100];&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;DatagramPacket dp = new&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;DatagramPacket(b1,b1.length);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;ds.receive(dp);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;String str = new String(dp.getData());&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;str = str.trim();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;Client &quot;+str);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;sequence=0;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;do&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;try&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;DatagramPacket(b2,b2.length);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&quot;+packet);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;byte b2[] = new byte[100];&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;DatagramPacket dp2 = new&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;ds.receive(dp2);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;String str2 = new String(dp2.getData());&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;packet = str2.trim();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;Packet is:=&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;if(packet.equals(&quot;end&quot;))&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;recived is:= &quot;+data);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;\nData&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;String temp = data;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;data = temp.replace(data, &quot; &quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;// System.out.println(&quot;sequence is:=&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&quot;+sequence);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;if(Integer.valueOf(packet.substring(0,1))==sequence)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&quot;+data);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;data+=packet.substring(1);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;data is:=&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;sequence=(sequence==0)?1:0;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;is:= &quot;+sequence);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;packet is:= &quot;+packet);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;// System.out.println(&quot;sequence&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;\nReceive&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Thread.sleep(2000);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;else&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;\nReceive&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;packet is:= &quot;+packet+&quot; with duplicate data&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Thread.sleep(2000);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;if(i&amp;lt;3)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;(String.valueOf(sequence)).getBytes();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;byte b3[] =&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;DatagramPacket dp3 = new&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;DatagramPacket(b3,b3.length,ia,dp.getPort());&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;ds.send(dp3);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;i++;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;Acknowledgment sended.&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Thread.sleep(2000);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;else&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;byte b4[] =&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;(String.valueOf((sequence+1)%2)).getBytes();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;DatagramPacket dp4 = new&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;DatagramPacket(b4,b4.length,ia,dp.getPort());&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;ds.send(dp4);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;i=0;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;Acknowledgment sended.&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Thread.sleep(2000);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;catch (Exception e)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.exit(0);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}while(!packet.equals(&quot;end&quot;));&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;byte b5[] = (&quot;connection ended.&quot;).getBytes();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;DatagramPacket dp5 = new&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;DatagramPacket(b5,b5.length,ia,dp.getPort());&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;ds.send(dp5);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;catch (Exception e)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.exit(0);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;public static void main(String args[])&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;A5_S_UDP obj = new A5_S_UDP();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;obj.start();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Output:&lt;/span&gt;&lt;/h1&gt;&lt;div&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiq66V2GnLtaq6i3cdshlp7mddHZ9tNFx-Yxakd-ru6l4hZx7BWZ5jCJpn4QX37XCmTp5DYbaa6Foo7MxxIWQ7NCZHpzgoNuwoq3XQzljpo_E0Ib5IBQJMA0ou1oI_37o2hXvkg38d9jPg1/s837/write-a-program-to-implement-stop-and-wait-arq-protocol-using-both-tcp-and-udp-dcn-subject-detail.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Write a program to implement Stop and Wait ARQ protocol using both TCP and UDP&quot; border=&quot;0&quot; data-original-height=&quot;612&quot; data-original-width=&quot;837&quot; height=&quot;468&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiq66V2GnLtaq6i3cdshlp7mddHZ9tNFx-Yxakd-ru6l4hZx7BWZ5jCJpn4QX37XCmTp5DYbaa6Foo7MxxIWQ7NCZHpzgoNuwoq3XQzljpo_E0Ib5IBQJMA0ou1oI_37o2hXvkg38d9jPg1/w640-h468/write-a-program-to-implement-stop-and-wait-arq-protocol-using-both-tcp-and-udp-dcn-subject-detail.png&quot; title=&quot;Write a program to implement Stop and Wait ARQ protocol using both TCP and UDP&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhN-JG4RcDtk_GbvjsX1LBAqokFtTuU5bOpBTVH1ggoGdzE1HReclAha6bIfohyphenhyphenBZQ4iVs_hyphenhyphenvSQxLpoULhPADjGn9esFycTXRJFYlEFYBA2hK9z0o5khP3MGC7EahlIv6FgTeU1lW2Uw1j/s714/write-a-program-to-implement-stop-and-wait-arq-protocol-using-both-tcp-and-udp-dcn-subject.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Write a program to implement Stop and Wait ARQ protocol using both TCP and UDP&quot; border=&quot;0&quot; data-original-height=&quot;587&quot; data-original-width=&quot;714&quot; height=&quot;526&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhN-JG4RcDtk_GbvjsX1LBAqokFtTuU5bOpBTVH1ggoGdzE1HReclAha6bIfohyphenhyphenBZQ4iVs_hyphenhyphenvSQxLpoULhPADjGn9esFycTXRJFYlEFYBA2hK9z0o5khP3MGC7EahlIv6FgTeU1lW2Uw1j/w640-h526/write-a-program-to-implement-stop-and-wait-arq-protocol-using-both-tcp-and-udp-dcn-subject.png&quot; title=&quot;Write a program to implement Stop and Wait ARQ protocol using both TCP and UDP&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2021/08/write-a-program-to-implement-stop-and-wait-protocol-using-both-tcp-and-udp.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;Stop and wait protocol with both TCP and UDP&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2021/08/food-habits-and-monsoon.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;Food habits and monsoon&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;Comment your views on this Article :)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2 style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;Thank you for visiting my blog :)&lt;/span&gt;&lt;/h2&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://techfreakforu.blogspot.com/feeds/3560403542273069575/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://techfreakforu.blogspot.com/2021/08/write-a-program-to-implement-stop-and-wait-arq-protocol-using-both-tcp-and-udp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/3560403542273069575'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/3560403542273069575'/><link rel='alternate' type='text/html' href='https://techfreakforu.blogspot.com/2021/08/write-a-program-to-implement-stop-and-wait-arq-protocol-using-both-tcp-and-udp.html' title='Write a program to implement Stop and Wait ARQ protocol using both TCP and UDP'/><author><name>Shubhank Shah</name><uri>http://www.blogger.com/profile/14127870435464846441</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmTbp8ZD9aPrsPr-snD4qfX_2SxjEvesdx4MVlpFmGFMF6U0kcCEKDPdKY3e9-TLxDjOor67Lq3IXtH-lC-IYsseQ85OQGVP_J6851CyJdTd-e79qVW4QM1XK8h09eeWo/s124/WhatsApp+Image+2020-06-15+at+1.30.36+PM.jpeg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2Iav_10iRPYst77RfzTmrW_zpniPB4ycddBtappc7vFTrFggKfWJmx5oMRGvt_Jr0wXpau6d6lXIhQ4WCuTU_fvXE7SlU71Lwx8e3vCd9R2kOiKzrhCpqN_5Job8TTO6zHrzBDM1a8DT0/s72-w640-h432-c/write-a-program-to-implement-stop-and-wait-arq-protocol-using-both-tcp-and-udp-dcn.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5267022146033422138.post-4502130724704156909</id><published>2021-08-07T11:18:00.001+05:30</published><updated>2021-08-09T21:48:43.981+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="DCN"/><title type='text'>Write a program to implement Stop and Wait Protocol using both TCP and UDP</title><content type='html'>&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Client Side:&lt;/span&gt;&lt;/h1&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;TCP&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.io.*;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.util.*;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.net.*;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;class A2_C_TCP&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;public static void main(String args[]) throws &lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Exception&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;A2_C_TCP obj = new &lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;A2_C_TCP();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;obj.run();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;public void run() throws Exception&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Scanner scan = new Scanner(System.in);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.print(&quot;Enter number of frames:= &quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;int n=scan.nextInt();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Socket s = new Socket(&quot;localhost&quot;, 9999);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;PrintStream ps = new PrintStream(s.getOutputStream());&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;for(int i=0;i&amp;lt;=n;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;if(i == n)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;ps.println(&quot;Exit&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;break;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;\nFrame &quot;+(i+1)+&quot; sent.&quot;); ps.println(i);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;BufferedReader br = new BufferedReader(new&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;InputStreamReader (s.getInputStream()));&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;String ack = br.readLine();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;if(ack != null)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;from server.&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;else&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;Acknowledgement was received&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;i++;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Thread.sleep(2000);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;Error.&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Server Side:&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.io.*;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.util.*;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.net.*;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;class A2_S_TCP&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;public static void main(String args[])throws Exception&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;A2_S_TCP obj = new A2_S_TCP();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;obj.run();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;public void run()throws Exception&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;String temp=&quot;any message&quot;, str=&quot;Exit&quot;;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;Server is starting.&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;ServerSocket ss = new ServerSocket(9999);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;Server is waiting for client request...&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Socket s = ss.accept();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;BufferedReader br = new BufferedReader(new&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;InputStreamReader (s.getInputStream()));&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;PrintStream ps = new PrintStream(s.getOutputStream());&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;while(temp.compareTo(str) != 0)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Thread.sleep(1000);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;temp=br.readLine();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;if(temp.compareTo(str)==0)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;break;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;\nReceived Frame&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&quot;+((Integer.valueOf(temp)+1)));&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Thread.sleep(500);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;ps.println(&quot;Received&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;\nAll frame was received successfully.&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Output:&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHjX9o2oxHt4t_9m9l_MjDcCVrbeGS8_LecoRdp1cipWB3YwtlCGp2kSJs-12MgCG9dERMNhLv9paJu-siqSoOpFNbpatt1GsDJ4aVWWNw9qeiJqrEjvaR4kgAbh7Z8nxR47fGhCqynj_Z/s258/write-a-program-to-implement-stop-and-wait-protocol-using-tcp-protocol-dcn.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Write a program to implement Stop and Wait Protocol using both TCP and UDP&quot; border=&quot;0&quot; data-original-height=&quot;239&quot; data-original-width=&quot;258&quot; height=&quot;593&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHjX9o2oxHt4t_9m9l_MjDcCVrbeGS8_LecoRdp1cipWB3YwtlCGp2kSJs-12MgCG9dERMNhLv9paJu-siqSoOpFNbpatt1GsDJ4aVWWNw9qeiJqrEjvaR4kgAbh7Z8nxR47fGhCqynj_Z/w640-h593/write-a-program-to-implement-stop-and-wait-protocol-using-tcp-protocol-dcn.png&quot; title=&quot;Write a program to implement Stop and Wait Protocol using both TCP and UDP&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimjZe5Q7x9J9znPCo-cOaj_5gVT05YQkjygM7c77HNAYQVpO0rpxAnTiRw1Id6MJ9k5LCV9RY9L0lPSLS2IYNGXM5t8Z-4PfgqBb6VgE2h66GxrJBSDjemCIxf1RCIm0gx_6Wnk6kRTbyt/s242/write-a-program-to-implement-stop-and-wait-protocol-using-tcp-protocol.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Write a program to implement Stop and Wait Protocol using both TCP and UDP&quot; border=&quot;0&quot; data-original-height=&quot;203&quot; data-original-width=&quot;242&quot; height=&quot;537&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimjZe5Q7x9J9znPCo-cOaj_5gVT05YQkjygM7c77HNAYQVpO0rpxAnTiRw1Id6MJ9k5LCV9RY9L0lPSLS2IYNGXM5t8Z-4PfgqBb6VgE2h66GxrJBSDjemCIxf1RCIm0gx_6Wnk6kRTbyt/w640-h537/write-a-program-to-implement-stop-and-wait-protocol-using-tcp-protocol.png&quot; title=&quot;Write a program to implement Stop and Wait Protocol using both TCP and UDP&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;UDP&lt;/span&gt;&lt;/h1&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Client Side:&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.io.*;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.util.*;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.net.*;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;class A2_C_UDP extends Thread&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;public static void main(String args[]) throws Exception&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;A2_C_UDP obj = new A2_C_UDP();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;obj.start();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;public void run()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;try&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Scanner scan = new Scanner(System.in);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.print(&quot;Enter number of frames:= &quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;int n=scan.nextInt();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;DatagramSocket ds = new DatagramSocket();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;InetAddress ia4 = InetAddress.getLocalHost();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;byte b4[] = String.valueOf(n).getBytes();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;DatagramPacket dp4 = new&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;DatagramPacket(b4,b4.length,ia4,9999);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;ds.send(dp4);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;for(int i=0;i&amp;lt;=n;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;if(i == n)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;InetAddress ia = InetAddress.getLocalHost();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;byte b1[] = String.valueOf(&quot;Exit&quot;).getBytes();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;DatagramPacket dp = new&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;DatagramPacket(b1,b1.length,ia,9999);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;ds.send(dp);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;break;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;\nFrame &quot;+(i+1)+&quot; sent.&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;InetAddress ia = InetAddress.getLocalHost();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;byte b2[] = String.valueOf((i)).getBytes();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;DatagramPacket dp2 = new&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;DatagramPacket(b2,b2.length,ia,9999);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;ds.send(dp2);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;acknowledgement...&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;Waiting for&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Thread.sleep(2000);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;byte b3[] = new byte[50];&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;DatagramPacket dp3 = new&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;DatagramPacket(b3,b3.length);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;ds.receive(dp3);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;String ack = new String(dp3.getData());&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;ack=ack.trim();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;int a = Integer.valueOf(ack);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;if(a == i)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;Acknowledgement was&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;received for frame &quot;+(i+1)+&quot; as &quot;+(a+1));&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;i++;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;else&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;Error.&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Thread.sleep(2000);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;catch(Exception e1)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;Error is:= &quot;+e1);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.exit(0);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Server side:&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.io.*;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.util.*;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.net.*;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;class A2_S_UDP extends Thread&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;public static void main(String args[]) throws Exception&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;A2_S_UDP obj = new A2_S_UDP();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;obj.start();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;public void run()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;try&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;String temp=&quot;&quot;, str=&quot;Exit&quot;;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;Server is starting.&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;DatagramSocket ds = new DatagramSocket(9999);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;DatagramSocket ds2 = new DatagramSocket(9998);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;Server is waiting for client request...&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;byte b3[] = new byte[50];&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;DatagramPacket dp3 = new DatagramPacket(b3,b3.length);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;ds.receive(dp3);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;String frameLength = new String(dp3.getData());&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;frameLength = frameLength.trim();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;int n = Integer.valueOf(frameLength);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;Frame Length is:= &quot;+frameLength);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;while(temp.compareTo(str) != 0)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Thread.sleep(2000);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;byte b1[] = new byte[50];&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;DatagramPacket dp = new&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;DatagramPacket(b1,b1.length);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;ds.receive(dp);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;temp = new String(dp.getData());&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;temp = temp.trim();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;if(temp.compareTo(str)==0)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;break;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;\nReceived Frame&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&quot;+((Integer.valueOf(temp)+1)));&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;Sending acknowledgement...&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Thread.sleep(2000);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;InetAddress ia = InetAddress.getLocalHost();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;int t = Integer.valueOf(temp);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;byte b2[] = String.valueOf(t).getBytes();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;DatagramPacket dp2 = new&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;DatagramPacket(b2,b2.length,ia,dp.getPort());&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;ds2.send(dp2);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;int f = Integer.valueOf(temp);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;Acknowledgement was sended&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;for frame &quot;+(f+1)+&quot; as &quot;+(t+1));&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;\nAll frame was received&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;successfully.&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;catch(Exception e1)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.out.println(&quot;Error is:= &quot;+e1);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;System.exit(0);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Output:&lt;/span&gt;&lt;/h1&gt;&lt;div&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk9xq4-eauYmsqPPqFprowIkS81EVmIX_ySOrhVWWTzSfRiDAaViSnI_yQVp36rK8iMzJIz83qriAA4RhCqhpy3Z0-WXjPgp5HE85R0z5NSxlvIcZ-4fpJ7ufsDx0X0yMiQuyviSSj8Sm5/s285/write-a-program-to-implement-stop-and-wait-protocol-using-udp-protocol-dcn.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Write a program to implement Stop and Wait Protocol using both TCP and UDP&quot; border=&quot;0&quot; data-original-height=&quot;165&quot; data-original-width=&quot;285&quot; height=&quot;371&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk9xq4-eauYmsqPPqFprowIkS81EVmIX_ySOrhVWWTzSfRiDAaViSnI_yQVp36rK8iMzJIz83qriAA4RhCqhpy3Z0-WXjPgp5HE85R0z5NSxlvIcZ-4fpJ7ufsDx0X0yMiQuyviSSj8Sm5/w640-h371/write-a-program-to-implement-stop-and-wait-protocol-using-udp-protocol-dcn.png&quot; title=&quot;Write a program to implement Stop and Wait Protocol using both TCP and UDP&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVqnVg2GOdG3Cg5UpEndO25jiQYG9PsSOLhx0PkNGnfQ2dlXbF2oL43aYyB9-6ejDdBnKwozs6cnchLglxQT2KyNlnugGpUmbd6cWz7JhXulLCllA0SfhJjQw_ScBHsXYd8t4q4p_r5xAy/s310/write-a-program-to-implement-stop-and-wait-protocol-using-udp-protocol.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Write a program to implement Stop and Wait Protocol using both TCP and UDP&quot; border=&quot;0&quot; data-original-height=&quot;155&quot; data-original-width=&quot;310&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVqnVg2GOdG3Cg5UpEndO25jiQYG9PsSOLhx0PkNGnfQ2dlXbF2oL43aYyB9-6ejDdBnKwozs6cnchLglxQT2KyNlnugGpUmbd6cWz7JhXulLCllA0SfhJjQw_ScBHsXYd8t4q4p_r5xAy/w640-h320/write-a-program-to-implement-stop-and-wait-protocol-using-udp-protocol.png&quot; title=&quot;Write a program to implement Stop and Wait Protocol using both TCP and UDP&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2021/08/latest-ielts-experience-2021-idp-computer-delivered.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;Know more about latest IELTS experience 2021&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2021/08/write-a-program-to-implement-stop-and-wait-arq-protocol-using-both-tcp-and-udp.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;Stop and wait ARQ protocol with TCP and UDP&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Comment your views on this Article :)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2 style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;Thank you for visiting my blog :)&lt;/span&gt;&lt;/h2&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://techfreakforu.blogspot.com/feeds/4502130724704156909/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://techfreakforu.blogspot.com/2021/08/write-a-program-to-implement-stop-and-wait-protocol-using-both-tcp-and-udp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/4502130724704156909'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/4502130724704156909'/><link rel='alternate' type='text/html' href='https://techfreakforu.blogspot.com/2021/08/write-a-program-to-implement-stop-and-wait-protocol-using-both-tcp-and-udp.html' title='Write a program to implement Stop and Wait Protocol using both TCP and UDP'/><author><name>Shubhank Shah</name><uri>http://www.blogger.com/profile/14127870435464846441</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmTbp8ZD9aPrsPr-snD4qfX_2SxjEvesdx4MVlpFmGFMF6U0kcCEKDPdKY3e9-TLxDjOor67Lq3IXtH-lC-IYsseQ85OQGVP_J6851CyJdTd-e79qVW4QM1XK8h09eeWo/s124/WhatsApp+Image+2020-06-15+at+1.30.36+PM.jpeg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHjX9o2oxHt4t_9m9l_MjDcCVrbeGS8_LecoRdp1cipWB3YwtlCGp2kSJs-12MgCG9dERMNhLv9paJu-siqSoOpFNbpatt1GsDJ4aVWWNw9qeiJqrEjvaR4kgAbh7Z8nxR47fGhCqynj_Z/s72-w640-h593-c/write-a-program-to-implement-stop-and-wait-protocol-using-tcp-protocol-dcn.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5267022146033422138.post-978253140716015623</id><published>2021-08-04T20:08:00.001+05:30</published><updated>2021-08-07T11:19:59.883+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Tech Guide"/><title type='text'>Latest IELTS Experience | 2021 | IDP | Result | Computer Delivered</title><content type='html'>&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Hello everyone, I hope you all are safe at your happy place.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Today, I&#39;m here to share my IELTS exam experience for those who are worrying about their IELTS exam (There is no need to worry).&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;I gave Computer Delivered IELTS through IDP in Ahmedabad.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;My exam was on 24th June 2021 and as I said I gave computer-delivered IELTS, so my speaking was on the same day (24th June 2021).&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Exam Venue: Computer Delivered IDP IELTS Test Center Ahmedabad&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Date: 24th June 2021&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Timing:&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Speaking - 10:40 am to 11:00 am&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;LRW - 1:00 pm to 4:00 pm&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana; font-size: x-large;&quot;&gt;Speaking Experience:&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Whether you choose paper-based IELTS or computer-delivered IELTS, speaking will always be in an in-person face-to-face interview.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;As I opted for computer-based IELTS, so my speaking was at Computer Delivered IDP IELTS Test Center Ahmedabad rather than a hotel (paper-based).&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;There was a soundproof room in which my speaking exam was conducted.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;When I entered that room, there was one examiner (Sir), who welcomed with my name and offered me to sit on one chair.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;As there is a corona crisis all around the world, wearing a mask is compulsory while giving the speaking test.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;So, I wore my mask and I thanked him with a &quot;Good Morning, Sir&quot; message before sitting in a chair.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;After then my speaking test was started.&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Part 1:&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Questions regarding my study and my hometown.&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Part 2:&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Que Card Topic - Describe about a place which you want to visit but don&#39;t want to live in.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Part 3:&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Questions regarding city and countryside area.&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Note - My speaking test was run around 10-11 minutes.&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Computer Delivered LRW Experience:&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;My LRW was at Computer Delivered IDP IELTS Test Center Ahmedabad.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Also, the mask is compulsory throughout the LRW.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;When I entered into the test room, a lot of computers were there and IDP is following corona protocol strictly so when it comes to sitting arrangements then there were only 2 students in each row (corner to corner).&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;The computer screen was big and suitable to use. The keyboard was very fine and also headphone was of very good quality.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;There were 2 water bottles were given already at our computer desk.&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;1) Listening&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;All the note completion question was ONE WORD ONLY.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Part 1 - Easy&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Part 2 - Easy&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Part 3 - Moderate&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Part 4 - Moderate&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;2) Reading&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;All the note completion questions were ONE WORD ONLY.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Section 1 - Easy&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Section 2 - Moderate&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Section 3 - Easy&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;3) Writing&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Task - 1 : Single Table&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Task - 2: To learn the way other cultures live it is better to watch films or video programs rather than to read books and newspapers. To what extent do you agree or disagree with these statements? Give your own opinion and examples.&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Important Tip:&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;While practicing speaking and LRW at your home, always do practice by wearing a mask to get comfortable for your exam day.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;During the examination, try to drink water if you get confused while giving LRW or Speaking. It will help you to reduce your mental stress.&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;My IELTS Result:&lt;/span&gt;&lt;/h1&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLkouDN_0sU6LCxIqo-GJ78jgCZjbUZ8qpXiKldRuRcdAA_wT85GMZqvnTtA3WkHLBSj9rsQLUJlviXkKVUZ6J3DOXWSam9gaidmC6VqduEMig83aF68bfDa51yKQMP_cuxNIayvkOfVpE/s1280/latest-ielts-result-2021-idp-computer-delivered.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;latest ielts result,idp,computer delivered ielts,2021,latest ielts experience&quot; border=&quot;0&quot; data-original-height=&quot;1280&quot; data-original-width=&quot;720&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLkouDN_0sU6LCxIqo-GJ78jgCZjbUZ8qpXiKldRuRcdAA_wT85GMZqvnTtA3WkHLBSj9rsQLUJlviXkKVUZ6J3DOXWSam9gaidmC6VqduEMig83aF68bfDa51yKQMP_cuxNIayvkOfVpE/w548-h640/latest-ielts-result-2021-idp-computer-delivered.jpg&quot; title=&quot;Latest IELTS Result | 2021 | IDP&quot; width=&quot;548&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2021/04/syntax-explanation-of-system-software-programs.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;Know more about syntax explanation of system software program&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2021/08/write-a-program-to-implement-stop-and-wait-protocol-using-both-tcp-and-udp.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;Stop and Wait Protocol using TCP and UDP&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Comment your views on this Article :)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2 style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;Thank you for visiting my blog :)&lt;/span&gt;&lt;/h2&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://techfreakforu.blogspot.com/feeds/978253140716015623/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://techfreakforu.blogspot.com/2021/08/latest-ielts-experience-2021-idp-computer-delivered.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/978253140716015623'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/978253140716015623'/><link rel='alternate' type='text/html' href='https://techfreakforu.blogspot.com/2021/08/latest-ielts-experience-2021-idp-computer-delivered.html' title='Latest IELTS Experience | 2021 | IDP | Result | Computer Delivered'/><author><name>Shubhank Shah</name><uri>http://www.blogger.com/profile/14127870435464846441</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmTbp8ZD9aPrsPr-snD4qfX_2SxjEvesdx4MVlpFmGFMF6U0kcCEKDPdKY3e9-TLxDjOor67Lq3IXtH-lC-IYsseQ85OQGVP_J6851CyJdTd-e79qVW4QM1XK8h09eeWo/s124/WhatsApp+Image+2020-06-15+at+1.30.36+PM.jpeg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLkouDN_0sU6LCxIqo-GJ78jgCZjbUZ8qpXiKldRuRcdAA_wT85GMZqvnTtA3WkHLBSj9rsQLUJlviXkKVUZ6J3DOXWSam9gaidmC6VqduEMig83aF68bfDa51yKQMP_cuxNIayvkOfVpE/s72-w548-h640-c/latest-ielts-result-2021-idp-computer-delivered.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5267022146033422138.post-2314103066429172138</id><published>2021-04-05T20:03:00.008+05:30</published><updated>2021-08-04T20:09:26.276+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Tech Guide"/><title type='text'>Syntax Explanation of System Software Programs </title><content type='html'>&lt;h1 style=&quot;text-align: left;&quot;&gt;&amp;nbsp;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;System Software&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;/p&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzrYPZ2PEM56CYFhx9IkeIv7l1ZOMgwqAZiCo4Q8jijjjxpsSpOC395OsHM0q0U8Q1bO9I8X-va1zZ3DyiKeT-azNZ8NJXCLGnRnxHtjh3eCJiSy20W9bEgvNIAe8Of5e7FIfS1PqzsTEH/s800/syntax-explanation-of-system-software-programs.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Syntax Explanation of System Software Programs,mnt,pntab,mdtp,sstp,apt,pdt,evt,evntab,ssntab,mdt,aptab,mnemonic&quot; border=&quot;0&quot; data-original-height=&quot;600&quot; data-original-width=&quot;800&quot; height=&quot;480&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzrYPZ2PEM56CYFhx9IkeIv7l1ZOMgwqAZiCo4Q8jijjjxpsSpOC395OsHM0q0U8Q1bO9I8X-va1zZ3DyiKeT-azNZ8NJXCLGnRnxHtjh3eCJiSy20W9bEgvNIAe8Of5e7FIfS1PqzsTEH/w640-h480/syntax-explanation-of-system-software-programs.png&quot; title=&quot;Syntax Explanation of System Software Programs&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt;Image Source - Google | Image By - &lt;a href=&quot;https://dribbble.com/shots/10969657-Syntax-Logo-Concept&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Dribble&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;1) MNT -&amp;gt; Macro Name Table.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;2) PNTAB -&amp;gt; Parameter Name Table.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;3) MDTP -&amp;gt; Macro Definition Table Pointer.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;4) SSTP -&amp;gt; Sequencing Symbol Table Pointer.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;5) APT -&amp;gt; Actual Parameter Table.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;6) PDT -&amp;gt; Parameter Default Table.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;7) EVT -&amp;gt; Expansion Time Variable Table.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;8) EVNTAB -&amp;gt; EV name are entered in EVNTAB while accessing EV declarations.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;9) SSNTAB -&amp;gt; SS name are entered in SSTAB while accessing SS declarations.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;10) MDT -&amp;gt; Macro Definition Table.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;11) APTAB -&amp;gt; Actual Parameter Table&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;12) MNEMONIC -&amp;gt; To represent machine operation or opcode.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;13) #PP -&amp;gt; Total number of positional parameters.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;14) #KP -&amp;gt; Total number of keyword parameters.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;15) #EV -&amp;gt; Total number of time variables.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;16) strtok -&amp;gt; Basically, it is a part of C library and it will split null string into tokens separation.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;17) fprintf -&amp;gt; formatted printf (you can format, how the data will be printed).&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;18) fclose -&amp;gt; it will close the defined stream.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;19) lit_table -&amp;gt; a literal pool is a lookup table used to hold literals during assembly and execution.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;20) ltorg -&amp;gt; assembler can collect the instruction and assemble literals into a literal pool.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;21) fgets -&amp;gt;&amp;nbsp; fgets will read a limited number of characters from a given file stream source into an array of characters.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;22) isdigit -&amp;gt; it can be used to check if the passed character is a digit or not. It returns a non-zero value if it&#39;s a digit else it returns 0. For example, it returns a non-zero value for &#39;0&#39; to &#39;9&#39; and zero for others.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2021/02/enter-a-set-of-numeric-values-at-client-side-and-send-it-to-server-side-server-will-fetch-the-values-and-return-all-prime-numbers-from-the-series-received-if-the-set-of-values-does-not-have-any-prime-number-return-0-use-tcp-protocol-implementation.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;Prime Number Using TCP Protocol&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2021/08/latest-ielts-experience-2021-idp-computer-delivered.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;IELTS Exam Experience&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Comment your views on this Article :)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2 style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;Thank you for visiting my blog :)&lt;/span&gt;&lt;/h2&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://techfreakforu.blogspot.com/feeds/2314103066429172138/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://techfreakforu.blogspot.com/2021/04/syntax-explanation-of-system-software-programs.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/2314103066429172138'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/2314103066429172138'/><link rel='alternate' type='text/html' href='https://techfreakforu.blogspot.com/2021/04/syntax-explanation-of-system-software-programs.html' title='Syntax Explanation of System Software Programs '/><author><name>Shubhank Shah</name><uri>http://www.blogger.com/profile/14127870435464846441</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmTbp8ZD9aPrsPr-snD4qfX_2SxjEvesdx4MVlpFmGFMF6U0kcCEKDPdKY3e9-TLxDjOor67Lq3IXtH-lC-IYsseQ85OQGVP_J6851CyJdTd-e79qVW4QM1XK8h09eeWo/s124/WhatsApp+Image+2020-06-15+at+1.30.36+PM.jpeg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzrYPZ2PEM56CYFhx9IkeIv7l1ZOMgwqAZiCo4Q8jijjjxpsSpOC395OsHM0q0U8Q1bO9I8X-va1zZ3DyiKeT-azNZ8NJXCLGnRnxHtjh3eCJiSy20W9bEgvNIAe8Of5e7FIfS1PqzsTEH/s72-w640-h480-c/syntax-explanation-of-system-software-programs.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5267022146033422138.post-6953027035044853323</id><published>2021-02-20T20:14:00.003+05:30</published><updated>2021-06-30T11:10:56.801+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="DCN"/><title type='text'>Prime Number | TCP Protocol | Data Communication and Networking</title><content type='html'>&lt;h1 style=&quot;text-align: left;&quot;&gt;&amp;nbsp;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Client&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.io.*;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.net.*;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;class Q3_Client&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;public static void main(String ar[]) throws Exception&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;Socket s=new Socket(&quot;localhost&quot;,12345);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;PrintWriter p=new PrintWriter(s.getOutputStream());&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;BufferedReader in=new BufferedReader(new InputStreamReader(s.getInputStream()));&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;BufferedReader ink=new BufferedReader(new InputStreamReader(System.in));&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;System.out.println(&quot;How many numbers Enter ? &quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;int num=Integer.parseInt(ink.readLine());&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;p.println(num);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;p.flush();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;System.out.println(&quot;Enter &quot;+num+&quot; numbers&amp;nbsp; :&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;String sarr[]=new String[num];&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;for(int i=0;i&amp;lt;num;i++)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;System.out.print(&quot;no. &quot;+i+&quot;=&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;sarr[i]=ink.readLine();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;p.println(sarr[i]);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;p.flush();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;String res;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;System.out.println(&quot;\nPrime Number::\n&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;while((res=in.readLine())!=null)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;System.out.print(res);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;s.close();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;			&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Server&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.io.*;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.net.*;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;class Q3_Server&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;public static void main(String ar[]) throws Exception&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;ServerSocket s1=new ServerSocket(12345);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;System.out.println(&quot;Server Started&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;Socket s=s1.accept();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;PrintWriter p=new PrintWriter(s.getOutputStream());&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;BufferedReader in=new BufferedReader(new InputStreamReader(s.getInputStream()));&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;String num=in.readLine();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;int n=Integer.parseInt(num);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;System.out.println(&quot;Client want to check &quot;+n+&quot; of Prime numbers&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;String sarr[]=new String[n];&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;int arr[]=new int[n];&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;int c;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;System.out.println(&quot;received numbers::\n&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;for(int i=0;i&amp;lt;n;i++)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;sarr[i]=in.readLine();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;arr[i]=Integer.parseInt(sarr[i]);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;System.out.println(&quot;no. &quot;+i+&quot;=&quot;+arr[i]);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;		&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int a[]=new int[n];&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int cnt=0;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;for (c = 0; c &amp;lt;&amp;nbsp; n ; c++)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if((arr[c]%2)!=0 || arr[c]==2){&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a[cnt]=arr[c];&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cnt++;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;System.out.println(&quot;\nlist of Prime numbers :&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;String sendarr=new String();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;if(cnt==0){&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;sendarr=&quot;Here not any prime number....&quot;;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;else{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;for (c = 0; c &amp;lt;cnt; c++)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;sendarr+=&quot; ,&quot;+a[c];&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;System.out.println(sendarr);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;p.println(sendarr);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;p.flush();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;s.close();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; s1.close();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Output&lt;/span&gt;&lt;/h1&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3Syr9dBgw22blwnlNFefguTGaLr-UGbhQ4i_VW-xd5stj9Fz1OeGZhBrKA3Bnaa364wvPgN3eHqqDt0yIkO_xZWtVrLJulFxglUDJgU0gZg5hJbSRRGBKzolQiNXVx9tCeyepM0ayFvjf/s591/enter-a-set-of-numeric-values-at-client-side-and-send-it-to-server-side-server-will-fetch-the-values-and-return-all-prime-numbers-from-the-series-received-if-the-set-of-values-does-not-have-any-prime-number-retu.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;find prime number,find prime number using tcp protocol,find prime number using tcp protocol in data communication and networking,data communication and networking&quot; border=&quot;0&quot; data-original-height=&quot;290&quot; data-original-width=&quot;591&quot; height=&quot;314&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3Syr9dBgw22blwnlNFefguTGaLr-UGbhQ4i_VW-xd5stj9Fz1OeGZhBrKA3Bnaa364wvPgN3eHqqDt0yIkO_xZWtVrLJulFxglUDJgU0gZg5hJbSRRGBKzolQiNXVx9tCeyepM0ayFvjf/w640-h314/enter-a-set-of-numeric-values-at-client-side-and-send-it-to-server-side-server-will-fetch-the-values-and-return-all-prime-numbers-from-the-series-received-if-the-set-of-values-does-not-have-any-prime-number-retu.png&quot; title=&quot;Prime Number | TCP Protocol | Data Communication and Networking&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhX__ooYKfTfoTUjbGM_kG725tofSYNua_lFJ_kif_YUweYHdmuQTXQOZmmpL8NN88eXTgeLLh56FACIeMIdEUrJ-OCfuUwbEivMKfOLnKpT789TK3xH_tbUfImuN5NFkORv0FNV5w1y83J/s637/enter-a-set-of-numeric-values-at-client-side-and-send-it-to-server-side-server-will-fetch-the-values-and-return-all-prime-numbers-from-the-series-received-if-the-set-of-values-does-not-have-any-prime-num.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;find prime number,find prime number using tcp protocol,find prime number using tcp protocol in data communication and networking,data communication and networking&quot; border=&quot;0&quot; data-original-height=&quot;284&quot; data-original-width=&quot;637&quot; height=&quot;286&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhX__ooYKfTfoTUjbGM_kG725tofSYNua_lFJ_kif_YUweYHdmuQTXQOZmmpL8NN88eXTgeLLh56FACIeMIdEUrJ-OCfuUwbEivMKfOLnKpT789TK3xH_tbUfImuN5NFkORv0FNV5w1y83J/w640-h286/enter-a-set-of-numeric-values-at-client-side-and-send-it-to-server-side-server-will-fetch-the-values-and-return-all-prime-numbers-from-the-series-received-if-the-set-of-values-does-not-have-any-prime-num.png&quot; title=&quot;Prime Number | TCP Protocol | Data Communication and Networking&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2021/02/request-a-number-from-client-side-and-server-will-calculate-the-cube-of-the-number-and-return-it-to-client-in-response-use-udp-protocol-implementation.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;UDP Protocol&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: helvetica; font-size: xx-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: #cfe2f3; font-family: helvetica;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2021/04/syntax-explanation-of-system-software-programs.html&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;Syntax | System Software&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Comment your views on this Article :)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2 style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;Thank you for visiting my blog :)&lt;/span&gt;&lt;/h2&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://techfreakforu.blogspot.com/feeds/6953027035044853323/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://techfreakforu.blogspot.com/2021/02/enter-a-set-of-numeric-values-at-client-side-and-send-it-to-server-side-server-will-fetch-the-values-and-return-all-prime-numbers-from-the-series-received-if-the-set-of-values-does-not-have-any-prime-number-return-0-use-tcp-protocol-implementation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/6953027035044853323'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/6953027035044853323'/><link rel='alternate' type='text/html' href='https://techfreakforu.blogspot.com/2021/02/enter-a-set-of-numeric-values-at-client-side-and-send-it-to-server-side-server-will-fetch-the-values-and-return-all-prime-numbers-from-the-series-received-if-the-set-of-values-does-not-have-any-prime-number-return-0-use-tcp-protocol-implementation.html' title='Prime Number | TCP Protocol | Data Communication and Networking'/><author><name>Shubhank Shah</name><uri>http://www.blogger.com/profile/14127870435464846441</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmTbp8ZD9aPrsPr-snD4qfX_2SxjEvesdx4MVlpFmGFMF6U0kcCEKDPdKY3e9-TLxDjOor67Lq3IXtH-lC-IYsseQ85OQGVP_J6851CyJdTd-e79qVW4QM1XK8h09eeWo/s124/WhatsApp+Image+2020-06-15+at+1.30.36+PM.jpeg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3Syr9dBgw22blwnlNFefguTGaLr-UGbhQ4i_VW-xd5stj9Fz1OeGZhBrKA3Bnaa364wvPgN3eHqqDt0yIkO_xZWtVrLJulFxglUDJgU0gZg5hJbSRRGBKzolQiNXVx9tCeyepM0ayFvjf/s72-w640-h314-c/enter-a-set-of-numeric-values-at-client-side-and-send-it-to-server-side-server-will-fetch-the-values-and-return-all-prime-numbers-from-the-series-received-if-the-set-of-values-does-not-have-any-prime-number-retu.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5267022146033422138.post-1286833360156217358</id><published>2021-02-10T20:39:00.003+05:30</published><updated>2021-06-30T11:12:34.205+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="DCN"/><title type='text'>UDP Protocol | Data Communication and Networking | Example </title><content type='html'>&lt;h1 style=&quot;text-align: left;&quot;&gt;&amp;nbsp;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Client&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.util.*;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.io.*;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.net.*;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;class Q2_Client{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; public static void main(String[] args) throws Exception {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Scanner scan=new Scanner(System.in);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DatagramSocket cSocket=new DatagramSocket();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; InetAddress iPAddress=InetAddress.getByName(&quot;localhost&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; byte[] sdata=new byte[1024];&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; byte[] rdata=new byte[1024];&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;\nEnter Number : &quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int st=scan.nextInt();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String s=String.valueOf(st);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sdata=s.getBytes();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DatagramPacket sPacket=new DatagramPacket(sdata, sdata.length, iPAddress, 0614);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cSocket.send(sPacket);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DatagramPacket rPacket=new DatagramPacket(rdata, rdata.length);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cSocket.receive(rPacket);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String mst=new String(rPacket.getData());&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;\nCube of &quot;+st+&quot; is: &quot;+mst);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cSocket.close();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; scan.close();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Server&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.io.*;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.net.*;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;class Q2_Server {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; public static void main(String[] args) throws Exception {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DatagramSocket sSocket=new DatagramSocket(0614);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; byte[] sdata=new byte[1024];&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; byte[] rdata=new byte[1024];&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; while(true){&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DatagramPacket sPacket=new DatagramPacket(rdata, rdata.length);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sSocket.receive(sPacket);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String str=new String(sPacket.getData());&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;System.out.println(&quot;\nConnection Established!!&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //System.out.println(&quot;\nSending Data : &quot;+cube);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int cube=Integer.parseInt(str.trim());&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cube=cube*cube*cube;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; str=Integer.toString(cube);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; InetAddress iAddress=sPacket.getAddress();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int port =sPacket.getPort();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;System.out.println(&quot;\nSending Data : &quot;+cube);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sdata=str.getBytes();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DatagramPacket sendPacket=new DatagramPacket(sdata, sdata.length, iAddress, port);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sSocket.send(sendPacket);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Output&lt;/span&gt;&lt;/h1&gt;&lt;div&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUyJ1kuEPLvqyfsXA0cWfU2nDP8CwvKWN2WQt8op2pM06ufLWpQRPeqA_sCf6O7HIz4E9bGhCu-c7hSuAZAncig7dvzAsBiF-QTd6A5GSMNmEmjFye0caepBMPE4_mCSXi9f3B7KViWZqM/s591/request-a-number-from-client-side-and-server-will-calculate-the-cube-of-the-number-and-return-it-to-client-in-response-use-udp-protocol-implementation.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;request a number from client-side and server will calculate the cube of the number and return it to client in response use udp protocol implementation,data communication and networking,concept of udp,concept of tcp,example of udp program&quot; border=&quot;0&quot; data-original-height=&quot;198&quot; data-original-width=&quot;591&quot; height=&quot;214&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUyJ1kuEPLvqyfsXA0cWfU2nDP8CwvKWN2WQt8op2pM06ufLWpQRPeqA_sCf6O7HIz4E9bGhCu-c7hSuAZAncig7dvzAsBiF-QTd6A5GSMNmEmjFye0caepBMPE4_mCSXi9f3B7KViWZqM/w640-h214/request-a-number-from-client-side-and-server-will-calculate-the-cube-of-the-number-and-return-it-to-client-in-response-use-udp-protocol-implementation.png&quot; title=&quot;UDP Protocol | Data Communication and Networking | Example&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOu3B1iRt5RzUmWhBt3siRioTZtPiR2fajLwmclP8ap9MAlvDZ-dSf70MGfaykfSxvBUNCMKRcvcXJ9rEnWQmN8P5uNb6mxljf0vHKrn3uRv__dtqyGhnAKXHax0tf5NJIV9eiPc1lrKt5/s625/request-a-number-from-client-side-and-server-will-calculate-the-cube-of-the-number-and-return-it-to-client-in-response-use-udp-protocol-implementation-dcn.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;request a number from client-side and server will calculate the cube of the number and return it to client in response use udp protocol implementation,data communication and networking,concept of udp,concept of tcp,example of udp program&quot; border=&quot;0&quot; data-original-height=&quot;183&quot; data-original-width=&quot;625&quot; height=&quot;188&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOu3B1iRt5RzUmWhBt3siRioTZtPiR2fajLwmclP8ap9MAlvDZ-dSf70MGfaykfSxvBUNCMKRcvcXJ9rEnWQmN8P5uNb6mxljf0vHKrn3uRv__dtqyGhnAKXHax0tf5NJIV9eiPc1lrKt5/w640-h188/request-a-number-from-client-side-and-server-will-calculate-the-cube-of-the-number-and-return-it-to-client-in-response-use-udp-protocol-implementation-dcn.png&quot; title=&quot;UDP Protocol | Data Communication and Networking | Example&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2021/02/request-a-number-from-client-side-and-server-will-calculate-the-square-of-the-number-and-return-it-to-client-in-response-use-tcp-protocol-implementation.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;TCP Protocol&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2021/02/enter-a-set-of-numeric-values-at-client-side-and-send-it-to-server-side-server-will-fetch-the-values-and-return-all-prime-numbers-from-the-series-received-if-the-set-of-values-does-not-have-any-prime-number-return-0-use-tcp-protocol-implementation.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;Prime Number Using TCP Protocol&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Comment your views on this Article :)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;Thank you for visiting my blog :)&lt;/span&gt;&lt;/h2&gt;&lt;div&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://techfreakforu.blogspot.com/feeds/1286833360156217358/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://techfreakforu.blogspot.com/2021/02/request-a-number-from-client-side-and-server-will-calculate-the-cube-of-the-number-and-return-it-to-client-in-response-use-udp-protocol-implementation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/1286833360156217358'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/1286833360156217358'/><link rel='alternate' type='text/html' href='https://techfreakforu.blogspot.com/2021/02/request-a-number-from-client-side-and-server-will-calculate-the-cube-of-the-number-and-return-it-to-client-in-response-use-udp-protocol-implementation.html' title='UDP Protocol | Data Communication and Networking | Example '/><author><name>Shubhank Shah</name><uri>http://www.blogger.com/profile/14127870435464846441</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmTbp8ZD9aPrsPr-snD4qfX_2SxjEvesdx4MVlpFmGFMF6U0kcCEKDPdKY3e9-TLxDjOor67Lq3IXtH-lC-IYsseQ85OQGVP_J6851CyJdTd-e79qVW4QM1XK8h09eeWo/s124/WhatsApp+Image+2020-06-15+at+1.30.36+PM.jpeg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUyJ1kuEPLvqyfsXA0cWfU2nDP8CwvKWN2WQt8op2pM06ufLWpQRPeqA_sCf6O7HIz4E9bGhCu-c7hSuAZAncig7dvzAsBiF-QTd6A5GSMNmEmjFye0caepBMPE4_mCSXi9f3B7KViWZqM/s72-w640-h214-c/request-a-number-from-client-side-and-server-will-calculate-the-cube-of-the-number-and-return-it-to-client-in-response-use-udp-protocol-implementation.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5267022146033422138.post-946542680652182738</id><published>2021-02-08T12:43:00.002+05:30</published><updated>2021-06-30T11:13:18.409+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="DCN"/><title type='text'>TCP Protocol | Data Communication and Networking | Example </title><content type='html'>&lt;h1 style=&quot;text-align: left;&quot;&gt;&amp;nbsp;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Client&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.net.* ;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.io.* ;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.util.*;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;public class Q1_Client{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; public static void main(String [] args)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Scanner scan=new Scanner(System.in);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Socket skt= new Socket(&quot;localhost&quot;,0722);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; InputStream in = skt.getInputStream();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; OutputStream out = skt.getOutputStream();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; byte[] sdata=new byte[1024];&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; byte[] rdata=new byte[1024];&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;\nEnter Number: &quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int st=scan.nextInt();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String s=String.valueOf(st);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sdata=s.getBytes();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; out.write(sdata);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; in.read(rdata);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String msg=new String(rdata);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;\nSquare of &quot;+st+&quot; is: &quot;+msg);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; out.close();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; skt.close();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; scan.close();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (Exception e) {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;Didn&#39;t get any Data....&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Server&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.net.* ;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.io.* ;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.util.*;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;public class Q1_Server{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; public static void main(String[] args)throws Exception {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ServerSocket srvr=new ServerSocket(0722);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Socket skt=srvr.accept();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;\nServer is connected!!&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; OutputStream out = skt.getOutputStream();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; InputStream in = skt.getInputStream();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; byte buf[]=new byte[50];&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; in.read(buf);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String msg=new String(buf);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int m=Integer.parseInt(msg.trim());&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; m=m*m;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;\nSending Data: &quot;+m);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; msg=String.valueOf(m);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; out.write(msg.getBytes());&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; in.close();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //srvr.close();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Output&lt;/span&gt;&lt;/h1&gt;&lt;div&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgo8s4aJlhr8yuBh0F5Z8Bw7TTlrLRtakhPfjRyy9C2hZxx49JHN0QGc9yFygnyix9IOMRUc5xTKBfYPgaQwZn-aeTDdkdcMZUnU0kuYOWjhSCxBqlYLqZ5sw0bzkXplWx9dFuZT94oLZnE/s591/request-a-number-from-client-side-and-server-will-calculate-the-square-of-the-number-and-return-it-to-client-in-response-use-tcp-protocol-implementation-dcn.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;request a number from client side and server will calculate the square of the number and return it to client in response use tcp protocol implementation,tcp protocol,data communication and networking&quot; border=&quot;0&quot; data-original-height=&quot;240&quot; data-original-width=&quot;591&quot; height=&quot;260&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgo8s4aJlhr8yuBh0F5Z8Bw7TTlrLRtakhPfjRyy9C2hZxx49JHN0QGc9yFygnyix9IOMRUc5xTKBfYPgaQwZn-aeTDdkdcMZUnU0kuYOWjhSCxBqlYLqZ5sw0bzkXplWx9dFuZT94oLZnE/w640-h260/request-a-number-from-client-side-and-server-will-calculate-the-square-of-the-number-and-return-it-to-client-in-response-use-tcp-protocol-implementation-dcn.png&quot; title=&quot;tcp protocol,data communication and networking,example,request a number from client side and server will calculate the square of the number and return it to client in response use tcp protocol implementation&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcvrH7Ly0EQq4nZwmp_FYPZuB53Qk9rw1dUWbrnyvd3cjU5hHfV6Op9x555yRfv7MIJZ3cM5-l21bRgQxL3LGpJm0KkCxycqFEk1sGdxmPAiKflvRRZP0yrsfrG_UENgbnxuooVqtMcg9c/s640/request-a-number-from-client-side-and-server-will-calculate-the-square-of-the-number-and-return-it-to-client-in-response-use-tcp-protocol-implementation.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;request a number from client side and server will calculate the square of the number and return it to client in response use tcp protocol implementation,tcp protocol,data communication and networking&quot; border=&quot;0&quot; data-original-height=&quot;163&quot; data-original-width=&quot;640&quot; height=&quot;164&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcvrH7Ly0EQq4nZwmp_FYPZuB53Qk9rw1dUWbrnyvd3cjU5hHfV6Op9x555yRfv7MIJZ3cM5-l21bRgQxL3LGpJm0KkCxycqFEk1sGdxmPAiKflvRRZP0yrsfrG_UENgbnxuooVqtMcg9c/w640-h164/request-a-number-from-client-side-and-server-will-calculate-the-square-of-the-number-and-return-it-to-client-in-response-use-tcp-protocol-implementation.png&quot; title=&quot;tcp protocol,data communication and networking,example,request a number from client side and server will calculate the square of the number and return it to client in response use tcp protocol implementation&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2020/12/write-a-java-program-to-perform-following-operations-insert-a-new-character-delete-a-character-append-two-strings-reverse-a-string.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;String operations in Java&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2021/02/request-a-number-from-client-side-and-server-will-calculate-the-cube-of-the-number-and-return-it-to-client-in-response-use-udp-protocol-implementation.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;UDP Protocol&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Comment your views on this Article :)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;Thank you for visiting my blog :)&lt;/span&gt;&lt;/h2&gt;&lt;div&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://techfreakforu.blogspot.com/feeds/946542680652182738/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://techfreakforu.blogspot.com/2021/02/request-a-number-from-client-side-and-server-will-calculate-the-square-of-the-number-and-return-it-to-client-in-response-use-tcp-protocol-implementation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/946542680652182738'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/946542680652182738'/><link rel='alternate' type='text/html' href='https://techfreakforu.blogspot.com/2021/02/request-a-number-from-client-side-and-server-will-calculate-the-square-of-the-number-and-return-it-to-client-in-response-use-tcp-protocol-implementation.html' title='TCP Protocol | Data Communication and Networking | Example '/><author><name>Shubhank Shah</name><uri>http://www.blogger.com/profile/14127870435464846441</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmTbp8ZD9aPrsPr-snD4qfX_2SxjEvesdx4MVlpFmGFMF6U0kcCEKDPdKY3e9-TLxDjOor67Lq3IXtH-lC-IYsseQ85OQGVP_J6851CyJdTd-e79qVW4QM1XK8h09eeWo/s124/WhatsApp+Image+2020-06-15+at+1.30.36+PM.jpeg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgo8s4aJlhr8yuBh0F5Z8Bw7TTlrLRtakhPfjRyy9C2hZxx49JHN0QGc9yFygnyix9IOMRUc5xTKBfYPgaQwZn-aeTDdkdcMZUnU0kuYOWjhSCxBqlYLqZ5sw0bzkXplWx9dFuZT94oLZnE/s72-w640-h260-c/request-a-number-from-client-side-and-server-will-calculate-the-square-of-the-number-and-return-it-to-client-in-response-use-tcp-protocol-implementation-dcn.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5267022146033422138.post-2396673273182279369</id><published>2020-12-16T23:20:00.002+05:30</published><updated>2021-06-30T11:14:03.919+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Tech Guide"/><title type='text'>Insert A New Character | Delete A Character | Append Two Strings | Reverse A String</title><content type='html'>&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Output&lt;/span&gt;&lt;/h1&gt;&lt;div&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvSDqbh-k3ETz9OtUWpPtJ5R8LSqhdMVi-8wRVEZUjG4UErlIg9Q3ta8ZCh12W_g57CfNjpMMam_9ShRRgnWdL3wEQ4i8VG4kn1Y8B0v3e07dXrbf7NNKdFOFZz3Eo1WA4WLzqXxIaGbHo/s632/write-a-java-program-to-perform-following-operations-insert-a-new-character-delete-a-character-append-two-strings-reverse-a-string.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;write a java program to perform following operations insert a new character delete a character append two strings reverse a string&quot; border=&quot;0&quot; data-original-height=&quot;293&quot; data-original-width=&quot;632&quot; height=&quot;296&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvSDqbh-k3ETz9OtUWpPtJ5R8LSqhdMVi-8wRVEZUjG4UErlIg9Q3ta8ZCh12W_g57CfNjpMMam_9ShRRgnWdL3wEQ4i8VG4kn1Y8B0v3e07dXrbf7NNKdFOFZz3Eo1WA4WLzqXxIaGbHo/w640-h296/write-a-java-program-to-perform-following-operations-insert-a-new-character-delete-a-character-append-two-strings-reverse-a-string.png&quot; title=&quot;Insert A New Character | Delete A Character | Append Two Strings | Reverse A String&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h1&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Code&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.util.Scanner;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;abstract class abs{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;StringBuffer str;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Scanner scan=new Scanner(System.in);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;abstract void ins();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;abstract void del();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;abstract void app();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;abstract void rev();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;class operations extends abs{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;operations(StringBuffer str){&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;this.str=str;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;void ins(){&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;dis(str);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;System.out.print(&quot;Enter Inserting String : &quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;String s1=scan.next();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;s1=&quot; &quot;+s1+&quot; &quot;;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;int i=str.length()+1;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;while(i&amp;gt;str.length()){&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;System.out.print(&quot;Enter Inserting Index : &quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;i=scan.nextInt();&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;System.out.print(&quot;After Inserting : &quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;dis(str.insert(i,s1));&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;void del(){&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;dis(str);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;int s1=str.length();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;while(s1&amp;gt;=str.length()){&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;System.out.print(&quot;Enter Delete Starting Index : &quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;s1=scan.nextInt();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;int i=str.length()+1;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;while(i&amp;gt;str.length() &amp;amp;&amp;amp; s1&amp;lt;i){&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;System.out.print(&quot;Enter Delete Last Index : &quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;i=scan.nextInt();&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;System.out.print(&quot;After Delete : &quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;dis(str.delete(s1,i));&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;void app(){&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;dis(str);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;System.out.print(&quot;Enter Apped String : &quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;String st=scan.next();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;System.out.print(&quot;After Appending : &quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;dis(str.append(&quot; &quot;).append(st));&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;void rev(){&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;dis(str);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;System.out.print(&quot;Reverse String :&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;dis(str.reverse());&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;void dis(StringBuffer str){&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;System.out.println(&quot;This is String : &quot;+str);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;this.str=str;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;class String_5{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;public static void main(String args[]){&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;operations op;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;Scanner scan=new Scanner(System.in);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;System.out.print(&quot;Enter String : &quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;String s1=scan.next();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;StringBuffer sb=new StringBuffer(s1);&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;op=new operations(sb);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;int c=1;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;while(c!=5){&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;System.out.print(&quot;operations :\n1.Insert a new character\n2.Delete a character\n3.Append two strings\n4.Reverse a string\n5.Exit\nEnter selection : &quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;c=scan.nextInt();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;switch(c){&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;case 1: op.ins(); break;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;case 2: op.del(); break;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;case 3: op.app(); break;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;case 4: op.rev(); break;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;case 5: System.out.print(&quot;Exit....&quot;); break;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;default : System.out.print(&quot;Invalid....&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2020/12/write-a-java-program-to-perform-following-operations-using-menu-driven-find-a-substring-find-a-length-of-the-string-find-a-particular-character-located-at-entered-index.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;String Handling In Java&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2021/02/request-a-number-from-client-side-and-server-will-calculate-the-square-of-the-number-and-return-it-to-client-in-response-use-tcp-protocol-implementation.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;TCP Protocol&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Comment your views on this Article :)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;Thank you for visiting my blog :)&lt;/span&gt;&lt;/h2&gt;&lt;div&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://techfreakforu.blogspot.com/feeds/2396673273182279369/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://techfreakforu.blogspot.com/2020/12/write-a-java-program-to-perform-following-operations-insert-a-new-character-delete-a-character-append-two-strings-reverse-a-string.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/2396673273182279369'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/2396673273182279369'/><link rel='alternate' type='text/html' href='https://techfreakforu.blogspot.com/2020/12/write-a-java-program-to-perform-following-operations-insert-a-new-character-delete-a-character-append-two-strings-reverse-a-string.html' title='Insert A New Character | Delete A Character | Append Two Strings | Reverse A String'/><author><name>Shubhank Shah</name><uri>http://www.blogger.com/profile/14127870435464846441</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmTbp8ZD9aPrsPr-snD4qfX_2SxjEvesdx4MVlpFmGFMF6U0kcCEKDPdKY3e9-TLxDjOor67Lq3IXtH-lC-IYsseQ85OQGVP_J6851CyJdTd-e79qVW4QM1XK8h09eeWo/s124/WhatsApp+Image+2020-06-15+at+1.30.36+PM.jpeg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvSDqbh-k3ETz9OtUWpPtJ5R8LSqhdMVi-8wRVEZUjG4UErlIg9Q3ta8ZCh12W_g57CfNjpMMam_9ShRRgnWdL3wEQ4i8VG4kn1Y8B0v3e07dXrbf7NNKdFOFZz3Eo1WA4WLzqXxIaGbHo/s72-w640-h296-c/write-a-java-program-to-perform-following-operations-insert-a-new-character-delete-a-character-append-two-strings-reverse-a-string.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5267022146033422138.post-8034495822777029769</id><published>2020-12-15T19:55:00.003+05:30</published><updated>2021-06-30T11:14:35.740+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Tech Guide"/><title type='text'>Find A Substring | Find A Length of The String | Find A Particular Character Located At Entered Index Number</title><content type='html'>&lt;h1 style=&quot;text-align: left;&quot;&gt;&amp;nbsp;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Output&lt;/span&gt;&lt;/h1&gt;&lt;div&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjB1-sdKp70A4-mFK7W_eRLpfHd7HaHfYxJRtLo0gizFtI41bXFsisWo1GQV5ACgTtLCc_vjWXmowRxYu0j3UMm0BBGeShzU_U5vhjXT5IzDrmgkmJD5DKw5xvsvF3aviOoMQlj5pYgUmh/s524/write-a-java-program-to-perform-following-operations-using-menu-driven-find-a-substring-find-a-length-of-the-string-find-a-particular-character-located-at-entered-index.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;write a java program to perform following operations using menu driven find a substring find a length of the string find a particular character located at entered index,java&quot; border=&quot;0&quot; data-original-height=&quot;337&quot; data-original-width=&quot;524&quot; height=&quot;412&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjB1-sdKp70A4-mFK7W_eRLpfHd7HaHfYxJRtLo0gizFtI41bXFsisWo1GQV5ACgTtLCc_vjWXmowRxYu0j3UMm0BBGeShzU_U5vhjXT5IzDrmgkmJD5DKw5xvsvF3aviOoMQlj5pYgUmh/w640-h412/write-a-java-program-to-perform-following-operations-using-menu-driven-find-a-substring-find-a-length-of-the-string-find-a-particular-character-located-at-entered-index.png&quot; title=&quot;Find A Substring | Find A Length of The String | Find A Particular Character Located At Entered Index Number&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h1&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Code&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;import java.util.Scanner;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;interface st{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;void Sub();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;void len();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;void index();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;class menu implements st{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Scanner scan = new Scanner(System.in);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;String org = &quot;&quot;;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;menu (String org) {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;this.org = org;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;public void Sub(){&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;System.out.print (&quot;Enter SubString : &quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;String s1 = scan.next();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;int in = org.indexOf (s1);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;if(in != -1)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;System.out.println (&quot;First occurrence of Substring &quot;+s1+&quot; is found at : &quot; +in);&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;else&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;System.out.println (&quot;Substring not found.....&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;public void len(){&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;int lengt = org.length();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;System.out.println (org+&quot; length is : &quot;+lengt);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;public void index(){&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;if (org.length() &amp;lt; 5)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;System.out.println (&quot;Their are not 5 char in String then replace not possible... &quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;else{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;System.out.println (&quot;Before changing String : &quot;+org);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;System.out.print (&quot;Enter Any Character : &quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;char c = scan.next().charAt (0);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;if (org.length() == 5)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;org = org.substring (0,4) + c;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;else&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;org = org.substring (0,4) + c+ org.substring (4+1);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;System.out.println (&quot;After changing String : &quot;+org);&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;class String_1{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;public static void main (String args [] ){&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;Scanner scan = new Scanner (System.in);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;int c = 1, i = 0;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;String org = &quot;&quot;;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;menu m1 = new menu (org);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;while (c != 5){&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;if (i == 0){&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;System.out.print (&quot;Enter String : &quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;org = scan.next();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;i++;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;m1 = new menu (org);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;System.out.println (&quot;\n\nSelect From Following Operations \n1.Find a substring\n2.Find a length of the string\n3.A particular character located at index no.5\n4.New String\n5.Exit&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;System.out.print (&quot;Enter Selection : &quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;c = scan.nextInt();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;System.out.println (&quot;\n&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;switch (c){&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;case 1: m1.Sub(); break;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;case 2: m1.len(); break;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;case 3: m1.index(); break;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;case 4: i=0; break;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;case 5: System.out.println(&quot;Eixting....&quot;); break;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;default : System.out.println(&quot;Invalid Selection.....&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2020/12/write-down-the-equation-and-transformation-matrix-for-3D-rotation-about-x-y-and-z-axis.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;3D Rotation In Computer Graphics&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2020/12/write-a-java-program-to-perform-following-operations-insert-a-new-character-delete-a-character-append-two-strings-reverse-a-string.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;String Operations In Java&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Comment your views on this Article :)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;Thank you for visiting my blog :)&lt;/span&gt;&lt;/h2&gt;&lt;div&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://techfreakforu.blogspot.com/feeds/8034495822777029769/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://techfreakforu.blogspot.com/2020/12/write-a-java-program-to-perform-following-operations-using-menu-driven-find-a-substring-find-a-length-of-the-string-find-a-particular-character-located-at-entered-index.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/8034495822777029769'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/8034495822777029769'/><link rel='alternate' type='text/html' href='https://techfreakforu.blogspot.com/2020/12/write-a-java-program-to-perform-following-operations-using-menu-driven-find-a-substring-find-a-length-of-the-string-find-a-particular-character-located-at-entered-index.html' title='Find A Substring | Find A Length of The String | Find A Particular Character Located At Entered Index Number'/><author><name>Shubhank Shah</name><uri>http://www.blogger.com/profile/14127870435464846441</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmTbp8ZD9aPrsPr-snD4qfX_2SxjEvesdx4MVlpFmGFMF6U0kcCEKDPdKY3e9-TLxDjOor67Lq3IXtH-lC-IYsseQ85OQGVP_J6851CyJdTd-e79qVW4QM1XK8h09eeWo/s124/WhatsApp+Image+2020-06-15+at+1.30.36+PM.jpeg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjB1-sdKp70A4-mFK7W_eRLpfHd7HaHfYxJRtLo0gizFtI41bXFsisWo1GQV5ACgTtLCc_vjWXmowRxYu0j3UMm0BBGeShzU_U5vhjXT5IzDrmgkmJD5DKw5xvsvF3aviOoMQlj5pYgUmh/s72-w640-h412-c/write-a-java-program-to-perform-following-operations-using-menu-driven-find-a-substring-find-a-length-of-the-string-find-a-particular-character-located-at-entered-index.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5267022146033422138.post-2650590261016679625</id><published>2020-12-14T16:14:00.002+05:30</published><updated>2021-06-30T11:15:13.761+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Tech Guide"/><title type='text'>Write Down The Equation And Transformation Matrix For 3D Rotation About X, Y and Z-Axis</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• For 3-D rotation, we need to pick an axis to rotate an object.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• The most common choices are the x-axis, y-axis, and z-axis.&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;X-Axis Rotation&lt;/span&gt;&lt;/h1&gt;&lt;div&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRa3Is-JTafjApjgC76VeaCac-F88BfZmMH0De8ZA3EV65D9RAn0BcUjz3vrqiDDqMc7Lo0bt2jA5sZ5cboNFi6YkIPrPLZf-B284-g5ivhdhZShYeDF9LGllIQ2ICI3WLogUifIx6h74E/s1874/write-down-the-equation-and-transformation-matrix-for-3D-rotation-about-x-y-and-z-axis.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;write down the equation and transformation matrix for 3D Rotation about X Y and Z-axis,3d rotation,3d rotation in computer graphics&quot; border=&quot;0&quot; data-original-height=&quot;1736&quot; data-original-width=&quot;1874&quot; height=&quot;592&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRa3Is-JTafjApjgC76VeaCac-F88BfZmMH0De8ZA3EV65D9RAn0BcUjz3vrqiDDqMc7Lo0bt2jA5sZ5cboNFi6YkIPrPLZf-B284-g5ivhdhZShYeDF9LGllIQ2ICI3WLogUifIx6h74E/w640-h592/write-down-the-equation-and-transformation-matrix-for-3D-rotation-about-x-y-and-z-axis.jpg&quot; title=&quot;Write down the equation and transformation matrix for 3D Rotation about X Y and Z-axis&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;• The transformation for x-axis is obtain from equation of z-axis rotation by replacing cyclically as shown here:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;x -&amp;gt; y -&amp;gt; z -&amp;gt; x&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Rotation about x-axis, we leave x co-ordinate unchanged.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;y&#39; = ycosθ - zsinθ&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;z&#39; = ysinθ + zcosθ&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;x&#39; = x&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Matrix equation is:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;p&#39; = Rx (θ) * p&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisD51zEOWN3NGFuQ5VJLCdUTjBtLdBCYmPqwhum9qEXxcvYztLLY9YNkS1oMEM6hfYiyUF4eEyXCcN3Ttwsrhy5-o4krvbl-tkucbqgHZiJDwx8p6sZAAFAJ3oUD9zMzpq_6drhCOe8gvc/s434/write-down-the-equation-and-transformation-matrix-for-3D-rotation-about-x-y-and-z-axis.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;write down the equation and transformation matrix for 3D Rotation about X Y and Z-axis,3d rotation,3d rotation in computer graphics,3d rotation in cg&quot; border=&quot;0&quot; data-original-height=&quot;190&quot; data-original-width=&quot;434&quot; height=&quot;280&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisD51zEOWN3NGFuQ5VJLCdUTjBtLdBCYmPqwhum9qEXxcvYztLLY9YNkS1oMEM6hfYiyUF4eEyXCcN3Ttwsrhy5-o4krvbl-tkucbqgHZiJDwx8p6sZAAFAJ3oUD9zMzpq_6drhCOe8gvc/w640-h280/write-down-the-equation-and-transformation-matrix-for-3D-rotation-about-x-y-and-z-axis.png&quot; title=&quot;Write down the equation and transformation matrix for 3D Rotation about X Y and Z-axis&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Y-Axis Rotation&lt;/span&gt;&lt;/h1&gt;&lt;div&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhatuf99NLoAJiRLNdNqPtS9C9a_aGkD2_vMSRAXZPb46e0WVbdjFr1pwHeQXYeaxa_FfepCj4Y64-DLi2eqTAHUCT8-DfogNZUQOSxBjAerFRTgdTkLiUHi8e1CcJW_MfyBq4fx9tA24KP/s1931/write-down-the-equation-and-transformation-matrix-for-3D-rotation-about-x-y-and-z-axis-in-cg.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;write down the equation and transformation matrix for 3D Rotation about X Y and Z-axis,3d rotation,3d rotation in computer graphics,3d rotation in cg&quot; border=&quot;0&quot; data-original-height=&quot;1216&quot; data-original-width=&quot;1931&quot; height=&quot;404&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhatuf99NLoAJiRLNdNqPtS9C9a_aGkD2_vMSRAXZPb46e0WVbdjFr1pwHeQXYeaxa_FfepCj4Y64-DLi2eqTAHUCT8-DfogNZUQOSxBjAerFRTgdTkLiUHi8e1CcJW_MfyBq4fx9tA24KP/w640-h404/write-down-the-equation-and-transformation-matrix-for-3D-rotation-about-x-y-and-z-axis-in-cg.jpg&quot; title=&quot;Write down the equation and transformation matrix for 3D Rotation about X Y and Z-axis&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: xx-large;&quot;&gt;•&lt;/span&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp;The transformation for y-axis is obtain from equation of x-axis rotation by replacing cyclically as shown here:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;x -&amp;gt; y -&amp;gt; z -&amp;gt; x&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Rotation about y-axis, we leave y co-ordinate unchanged.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;z&#39; = zcosθ - xsinθ&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;x&#39; = zsinθ + xcosθ&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;y&#39; = y&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Matrix equation is:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;p&#39; = Ry (θ) * p&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZv-ZCZ920kZHvK7Mh4YYgo4hZEQby_RPqQiWTdLcgP_k3YpZ9hdkY-nJ3Aomb4YHvBxeSy1X4jlniIrPT1l-UWKtAHIyME-fdDWrZ-pF2TXnZeduiOfzHLiTrD7N-fDgvySPyIB_Wkdgy/s399/write-down-the-equation-and-transformation-matrix-for-3D-rotation-about-x-y-and-z-axis-in-cg.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;write down the equation and transformation matrix for 3D Rotation about X Y and Z-axis,3d rotation,3d rotation in computer graphics,3d rotation in cg&quot; border=&quot;0&quot; data-original-height=&quot;140&quot; data-original-width=&quot;399&quot; height=&quot;224&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZv-ZCZ920kZHvK7Mh4YYgo4hZEQby_RPqQiWTdLcgP_k3YpZ9hdkY-nJ3Aomb4YHvBxeSy1X4jlniIrPT1l-UWKtAHIyME-fdDWrZ-pF2TXnZeduiOfzHLiTrD7N-fDgvySPyIB_Wkdgy/w640-h224/write-down-the-equation-and-transformation-matrix-for-3D-rotation-about-x-y-and-z-axis-in-cg.png&quot; title=&quot;Write down the equation and transformation matrix for 3D Rotation about X Y and Z-axis&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Z-Axis Rotation&lt;/span&gt;&lt;/h1&gt;&lt;div&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguCobwxzh6Gqbz-GvmbFJU32Dv4yodMNZCd3fzEzeY72BNynZ3CtPuE0J1tb4WewtOqJL5TvqdgP5FllerAr-L4aWXguTmJUY1JVtVXI99i3_JS9MwZKv6VKecJzBm_dwTPAE2QBi_BvKw/s1800/write-down-the-equation-and-transformation-matrix-for-3D-rotation-about-x-y-and-z-axis-in-computer-graphics.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;write down the equation and transformation matrix for 3D Rotation about X Y and Z-axis,3d rotation,3d rotation in computer graphics,3d rotation in cg&quot; border=&quot;0&quot; data-original-height=&quot;1800&quot; data-original-width=&quot;1724&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguCobwxzh6Gqbz-GvmbFJU32Dv4yodMNZCd3fzEzeY72BNynZ3CtPuE0J1tb4WewtOqJL5TvqdgP5FllerAr-L4aWXguTmJUY1JVtVXI99i3_JS9MwZKv6VKecJzBm_dwTPAE2QBi_BvKw/w612-h640/write-down-the-equation-and-transformation-matrix-for-3D-rotation-about-x-y-and-z-axis-in-computer-graphics.jpg&quot; title=&quot;Write down the equation and transformation matrix for 3D Rotation about X Y and Z-axis&quot; width=&quot;612&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt;&lt;p&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;• Two-dimension rotation equation can be easily converted into 3-D z-axis rotation equation.&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Rotation about z-axis, we leave z co-ordinate unchanged.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;x&#39; = xcosθ - ysinθ&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;y&#39; = xsinθ + ycosθ&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;z&#39; = z&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Where, parameter θ specify rotation angle.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Matrix equation is:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;p&#39; = Rz (θ) * p&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4puUg8O3_t1fHgL1s3FEC6qIiRbmH7jFRXiU81rCmYQgcF0miieoTOUuMBwM3P3j4V-J0D0lG2kzEZF6UnerjAMOeOi_bsLko9vMs2l85hC3wQy5u2fuv7iy61gkyuSYC3MVTr_Wbe5XY/s396/write-down-the-equation-and-transformation-matrix-for-3D-rotation-about-x-y-and-z-axis-in-computer-graphics.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;write down the equation and transformation matrix for 3D Rotation about X Y and Z-axis,3d rotation,3d rotation in computer graphics,3d rotation in cg&quot; border=&quot;0&quot; data-original-height=&quot;154&quot; data-original-width=&quot;396&quot; height=&quot;248&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4puUg8O3_t1fHgL1s3FEC6qIiRbmH7jFRXiU81rCmYQgcF0miieoTOUuMBwM3P3j4V-J0D0lG2kzEZF6UnerjAMOeOi_bsLko9vMs2l85hC3wQy5u2fuv7iy61gkyuSYC3MVTr_Wbe5XY/w640-h248/write-down-the-equation-and-transformation-matrix-for-3D-rotation-about-x-y-and-z-axis-in-computer-graphics.png&quot; title=&quot;Write down the equation and transformation matrix for 3D Rotation about X Y and Z-axis&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2020/12/derive-the-equation-and-transformation-matrix-for-producing-parallel-projection-on-2D-viewing-plane-explain-orthographic-and-oblique-projections.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;2-D Viewing Plane In Computer Graphics&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2020/12/write-a-java-program-to-perform-following-operations-using-menu-driven-find-a-substring-find-a-length-of-the-string-find-a-particular-character-located-at-entered-index.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;String Handling In Java&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Comment your views on this Article :)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;Thank you for visiting my blog :)&lt;/span&gt;&lt;/h2&gt;&lt;div&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://techfreakforu.blogspot.com/feeds/2650590261016679625/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://techfreakforu.blogspot.com/2020/12/write-down-the-equation-and-transformation-matrix-for-3D-rotation-about-x-y-and-z-axis.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/2650590261016679625'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/2650590261016679625'/><link rel='alternate' type='text/html' href='https://techfreakforu.blogspot.com/2020/12/write-down-the-equation-and-transformation-matrix-for-3D-rotation-about-x-y-and-z-axis.html' title='Write Down The Equation And Transformation Matrix For 3D Rotation About X, Y and Z-Axis'/><author><name>Shubhank Shah</name><uri>http://www.blogger.com/profile/14127870435464846441</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmTbp8ZD9aPrsPr-snD4qfX_2SxjEvesdx4MVlpFmGFMF6U0kcCEKDPdKY3e9-TLxDjOor67Lq3IXtH-lC-IYsseQ85OQGVP_J6851CyJdTd-e79qVW4QM1XK8h09eeWo/s124/WhatsApp+Image+2020-06-15+at+1.30.36+PM.jpeg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRa3Is-JTafjApjgC76VeaCac-F88BfZmMH0De8ZA3EV65D9RAn0BcUjz3vrqiDDqMc7Lo0bt2jA5sZ5cboNFi6YkIPrPLZf-B284-g5ivhdhZShYeDF9LGllIQ2ICI3WLogUifIx6h74E/s72-w640-h592-c/write-down-the-equation-and-transformation-matrix-for-3D-rotation-about-x-y-and-z-axis.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5267022146033422138.post-6408441924968775536</id><published>2020-12-13T20:17:00.002+05:30</published><updated>2021-06-30T11:15:43.546+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Tech Guide"/><title type='text'>Derive The Equation And Transformation Matrix For Producing Parallel Projection On 2D Viewing Plane And Also Explain Orthographic And Oblique Projections</title><content type='html'>&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Parallel projection methods are used by engineers to create and working drawing of an object which preserves its true value.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• In the case of parallel projection the rays from an object coverage at infinity, unlike the perspective projection where the rays from an object converse at infinite distance.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Parallel projection can be categorized according to the angle that projection of direction plan.&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Transformation of Parallel Projection&lt;/span&gt;&amp;nbsp;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Parallel projection (are also known as orthographic projection) is projections into one of the coordinate plans.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;x = 0, y = 0 and z = 0&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• The standard transformation parallel projection into the xy plane (i.e = z = 0 plans) is:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;z = x&#39; = x&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; y&#39; = y&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; z&#39; = 0&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• In matrix form:&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgufjLvozpFgqZpP9Cx2myq8oMGv4a8tdFEAGKaJ8Q73nyx7J141amqpNpNs0iZiRE4JmaZrhL8c6DK5dH-CWltjkMXCUixSNO_Jipf-RQ4FeaFb9HvItCScq2VjSGCZs5mWE5qN2BQUrlA/s1676/derive-the-equation-and-transformation-matrix-for-producing-parallel-projection-on-2D-viewing-plane-also-explain-orthographic-and-oblique-projections.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;derive the equation and transformation matrix for producing parallel projection on 2D viewing plane,explain orthographic and oblique projections&quot; border=&quot;0&quot; data-original-height=&quot;557&quot; data-original-width=&quot;1676&quot; height=&quot;212&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgufjLvozpFgqZpP9Cx2myq8oMGv4a8tdFEAGKaJ8Q73nyx7J141amqpNpNs0iZiRE4JmaZrhL8c6DK5dH-CWltjkMXCUixSNO_Jipf-RQ4FeaFb9HvItCScq2VjSGCZs5mWE5qN2BQUrlA/w640-h212/derive-the-equation-and-transformation-matrix-for-producing-parallel-projection-on-2D-viewing-plane-also-explain-orthographic-and-oblique-projections.jpg&quot; title=&quot;Derive The Equation And Transformation Matrix For Producing Parallel Projection On 2D Viewing Plane, Explain Orthographic And Oblique Projections&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h1&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Orthographic Parallel Equation&amp;nbsp;&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• When the projection lines are perpendicular to the view plane, we have an orthographic parallel equation.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Orthographic projections are most often used to produce the front, side and top view of an object.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Engineering and architecture drawings commonly used in orthographic projections.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Because length and angle are accurately depicted and can be measure from the drawing.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Transformation equations for an orthographic parallel projection are straight forward.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Figure of orthographic parallel projection is given below:&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhS0l47zFurAFYMHawtAiYWOBRDxPZtNN4myPlZ__WS1L_fWsUSTo81i-aZHcmBqpE5zngQ9IvuZiGPYsMXlL9wrVVDCcqmSCg5zq8vUGRAYLLuSJpcd9T00apfWB4eNgR4emyvrvMg6jgv/s1754/derive-the-equation-and-transformation-matrix-for-producing-parallel-projection-on-2D-viewing-plane-explain-orthographic-and-oblique-projections.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;derive the equation and transformation matrix for producing parallel projection on 2D viewing plane,explain orthographic and oblique projections&quot; border=&quot;0&quot; data-original-height=&quot;1754&quot; data-original-width=&quot;1692&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhS0l47zFurAFYMHawtAiYWOBRDxPZtNN4myPlZ__WS1L_fWsUSTo81i-aZHcmBqpE5zngQ9IvuZiGPYsMXlL9wrVVDCcqmSCg5zq8vUGRAYLLuSJpcd9T00apfWB4eNgR4emyvrvMg6jgv/w618-h640/derive-the-equation-and-transformation-matrix-for-producing-parallel-projection-on-2D-viewing-plane-explain-orthographic-and-oblique-projections.jpg&quot; title=&quot;Derive The Equation And Transformation Matrix For Producing Parallel Projection On 2D Viewing Plane, Explain Orthographic And Oblique Projections&quot; width=&quot;618&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h1&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Oblique Parallel Projection&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• An oblique projection is obtained by projecting points.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Along parallel lines that are not perpendicular to the projection plane.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Coordinates of oblique parallel projection can be obtained as:&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhejZq1UrcIUXFKYNdktkmj2-Rh3kmNJKNxw0J4UkErk_CWukk__A9ovPv6ht_V6VFRuQK6jgx9fnz05ZxDM4XI0ews8I1Sw5v51T-8bNLhs7zYotUHe4_W8ynG_fsc0TcPiwahscnJQo42/s1537/derive-the-equation-and-transformation-matrix-for-producing-parallel-projection-on-2D-viewing-plane-and-explain-orthographic-and-oblique-projections.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;derive the equation and transformation matrix for producing parallel projection on 2D viewing plane,explain orthographic and oblique projections&quot; border=&quot;0&quot; data-original-height=&quot;1148&quot; data-original-width=&quot;1537&quot; height=&quot;478&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhejZq1UrcIUXFKYNdktkmj2-Rh3kmNJKNxw0J4UkErk_CWukk__A9ovPv6ht_V6VFRuQK6jgx9fnz05ZxDM4XI0ews8I1Sw5v51T-8bNLhs7zYotUHe4_W8ynG_fsc0TcPiwahscnJQo42/w640-h478/derive-the-equation-and-transformation-matrix-for-producing-parallel-projection-on-2D-viewing-plane-and-explain-orthographic-and-oblique-projections.jpg&quot; title=&quot;Derive The Equation And Transformation Matrix For Producing Parallel Projection On 2D Viewing Plane, Explain Orthographic And Oblique Projections&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• As shown in the above figure (x, y, z) is a point at which we are taking oblique projection (x, y), (y, p) on the view plane is an orthographic projection of (x, y, z).&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;xp = x + ∠cosθ&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;yp = y + ∠sinθ&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;∠ = z / tanx&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;so, tanx = z / ∠&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2020/12/given-a-clipping-window-p-20-20-q-60-20-r-60-40-and-s-20-40-use-cohan-sutherland-to-determine-the-visible-portion-of-the-line-a-40-80-and-b-120-30.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;Cohen Sutherland In Computer Graphics&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2020/12/write-down-the-equation-and-transformation-matrix-for-3D-rotation-about-x-y-and-z-axis.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;3-D Rotation In Computer Graphics&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Comment your views on this Article :)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;Thank you for visiting my blog :)&lt;/span&gt;&lt;/h2&gt;&lt;div&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://techfreakforu.blogspot.com/feeds/6408441924968775536/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://techfreakforu.blogspot.com/2020/12/derive-the-equation-and-transformation-matrix-for-producing-parallel-projection-on-2D-viewing-plane-explain-orthographic-and-oblique-projections.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/6408441924968775536'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/6408441924968775536'/><link rel='alternate' type='text/html' href='https://techfreakforu.blogspot.com/2020/12/derive-the-equation-and-transformation-matrix-for-producing-parallel-projection-on-2D-viewing-plane-explain-orthographic-and-oblique-projections.html' title='Derive The Equation And Transformation Matrix For Producing Parallel Projection On 2D Viewing Plane And Also Explain Orthographic And Oblique Projections'/><author><name>Shubhank Shah</name><uri>http://www.blogger.com/profile/14127870435464846441</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmTbp8ZD9aPrsPr-snD4qfX_2SxjEvesdx4MVlpFmGFMF6U0kcCEKDPdKY3e9-TLxDjOor67Lq3IXtH-lC-IYsseQ85OQGVP_J6851CyJdTd-e79qVW4QM1XK8h09eeWo/s124/WhatsApp+Image+2020-06-15+at+1.30.36+PM.jpeg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgufjLvozpFgqZpP9Cx2myq8oMGv4a8tdFEAGKaJ8Q73nyx7J141amqpNpNs0iZiRE4JmaZrhL8c6DK5dH-CWltjkMXCUixSNO_Jipf-RQ4FeaFb9HvItCScq2VjSGCZs5mWE5qN2BQUrlA/s72-w640-h212-c/derive-the-equation-and-transformation-matrix-for-producing-parallel-projection-on-2D-viewing-plane-also-explain-orthographic-and-oblique-projections.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5267022146033422138.post-1456349260387289142</id><published>2020-12-12T20:26:00.002+05:30</published><updated>2021-06-30T11:16:24.294+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Tech Guide"/><title type='text'>Given a Clipping Window P(20,20), Q(60,20), R(60,40) and S(20,40), Use Cohen Sutherland To Determine The Visible Portion of The Line A(40,80) and B(120,30)</title><content type='html'>&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Solution&lt;/span&gt;&lt;/h1&gt;&lt;div&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVHJlPEBdqaDA3w3KyJ72tfj7BE8CXDRvhZIStByxWMpVH2B5q7apadENTWiAIOXUU4n_CVrdwFBlrhp7BiP_2iCvjLaRovOx4h4-9eFz8pdYj3oWnM4ON0aZF5pnBXuEfSllYmOelAFzD/s1945/given-a-clipping-window-p-20-20-q-60-20-r-60-40-and-s-20-40-use-cohan-sutherland-to-determine-the-visible-portion-of-the-line-a-40-80-and-b-120-30.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Given a clipping window P(20,20), Q(60,20), R(60,40) and S(20,40), use Cohen Sutherland to determine the visible portion of the line A(40,80) and B(120,30)&quot; border=&quot;0&quot; data-original-height=&quot;1460&quot; data-original-width=&quot;1945&quot; height=&quot;480&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVHJlPEBdqaDA3w3KyJ72tfj7BE8CXDRvhZIStByxWMpVH2B5q7apadENTWiAIOXUU4n_CVrdwFBlrhp7BiP_2iCvjLaRovOx4h4-9eFz8pdYj3oWnM4ON0aZF5pnBXuEfSllYmOelAFzD/w640-h480/given-a-clipping-window-p-20-20-q-60-20-r-60-40-and-s-20-40-use-cohan-sutherland-to-determine-the-visible-portion-of-the-line-a-40-80-and-b-120-30.jpg&quot; title=&quot;Given a clipping window P(20,20), Q(60,20), R(60,40) and S(20,40), use Cohen Sutherland to determine the visible portion of the line A(40,80) and B(120,30)&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Clipline (40, 80, 120, 30, 20, 60, 20, 40)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;code1 = 0000&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;done = 0&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;code2 = 0000&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;draw = 0&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;while (done == 0)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;code1 = encode (x1, y1)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;encode (40, 80)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;if (x &amp;lt; xwmin) (40 &amp;lt; 20)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;false&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;if (x &amp;gt; xwmax) (40 &amp;gt; 40)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;false&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;if (y &amp;lt; ywmin) (80 &amp;lt; 20)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;false&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;if (y &amp;gt; ywmax) (80 &amp;gt; 60) true&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;code = 1000&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;So, code1 = 1000&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;code2 = encode (120, 30)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;encode (120, 30)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;if (x &amp;lt; xwmin) (120 &amp;lt; 20)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;false&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;if (x &amp;gt; xwmax) (120 &amp;gt; 40) true&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;code = 0010&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;if (y &amp;lt; ywmin) (30 &amp;lt; 20)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;false&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;if (y &amp;gt; ywmax) (30 &amp;gt; 60) false&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;code2 = 0010&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;ans = accept (code1, code2)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;accept (1000, 0010)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;if (! (a ! b)) !(1000 ! 0010)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;false&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;else&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;return 0&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;So, ans = 0&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;if (ans == 1)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;{&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;false&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;else&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;ans = reject (code1, code2)&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;reject (1000, 0010)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;if (a &amp;amp; b) (1000 &amp;amp; 0010)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;false&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;else&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;return 0&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;So, ans = 0&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;if (ans == 1)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;false&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;else&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;if (inside (code1))&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;false&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;if (x1 != x2)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;m = (y2 - y1) / (x2 - x1)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = (30 -80) / (120 - 40)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&amp;nbsp; &amp;nbsp; = (-50) / (80)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&amp;nbsp; &amp;nbsp; = - 0.625&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;if (code1 &amp;amp; lb)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;false&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;else if (code1 &amp;amp;&amp;amp; b)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;false&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;else if (code1 &amp;amp; bb)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;false&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;else if (code1 &amp;amp; tb) true (1000 &amp;amp; 1000)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;x1 = y1 + (ymax - y1) / m&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;y1 = ymax&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;while (done == 0)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;code1 = 0010 = encode (112, 60)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;code2 = 0010 = encode (120, 30)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;ans = accept (code1, code2)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;if (ans == 1)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;flase&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;else&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;ans = 1 = reject (code1, code2)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;if (ans == 1)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;true&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;done = 1&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;while (draw == 1) true&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;dda (112, 60, 120, 30)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2020/12/double-buffering-in-computer-graphics.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;Double Buffering In Computer Graphics&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2020/12/derive-the-equation-and-transformation-matrix-for-producing-parallel-projection-on-2D-viewing-plane-explain-orthographic-and-oblique-projections.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;2D Viewing Plane In Computer Graphics&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Comment your views on this Article :)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;Thank you for visiting my blog :)&lt;/span&gt;&lt;/h2&gt;&lt;div&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://techfreakforu.blogspot.com/feeds/1456349260387289142/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://techfreakforu.blogspot.com/2020/12/given-a-clipping-window-p-20-20-q-60-20-r-60-40-and-s-20-40-use-cohan-sutherland-to-determine-the-visible-portion-of-the-line-a-40-80-and-b-120-30.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/1456349260387289142'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/1456349260387289142'/><link rel='alternate' type='text/html' href='https://techfreakforu.blogspot.com/2020/12/given-a-clipping-window-p-20-20-q-60-20-r-60-40-and-s-20-40-use-cohan-sutherland-to-determine-the-visible-portion-of-the-line-a-40-80-and-b-120-30.html' title='Given a Clipping Window P(20,20), Q(60,20), R(60,40) and S(20,40), Use Cohen Sutherland To Determine The Visible Portion of The Line A(40,80) and B(120,30)'/><author><name>Shubhank Shah</name><uri>http://www.blogger.com/profile/14127870435464846441</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmTbp8ZD9aPrsPr-snD4qfX_2SxjEvesdx4MVlpFmGFMF6U0kcCEKDPdKY3e9-TLxDjOor67Lq3IXtH-lC-IYsseQ85OQGVP_J6851CyJdTd-e79qVW4QM1XK8h09eeWo/s124/WhatsApp+Image+2020-06-15+at+1.30.36+PM.jpeg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVHJlPEBdqaDA3w3KyJ72tfj7BE8CXDRvhZIStByxWMpVH2B5q7apadENTWiAIOXUU4n_CVrdwFBlrhp7BiP_2iCvjLaRovOx4h4-9eFz8pdYj3oWnM4ON0aZF5pnBXuEfSllYmOelAFzD/s72-w640-h480-c/given-a-clipping-window-p-20-20-q-60-20-r-60-40-and-s-20-40-use-cohan-sutherland-to-determine-the-visible-portion-of-the-line-a-40-80-and-b-120-30.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5267022146033422138.post-4637469579371068881</id><published>2020-12-09T22:29:00.002+05:30</published><updated>2021-06-30T11:16:55.945+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Tech Guide"/><title type='text'>Double Buffering In Computer Graphics</title><content type='html'>&lt;h1 style=&quot;text-align: left;&quot;&gt;&amp;nbsp;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Double Buffering&lt;/span&gt;&lt;/h1&gt;&lt;div&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhc7atvIb3ungczWUtSjfNFxXVolewCriP3CAv3HX4i6TP95wCiaYlnYvmGXiW1WKbJJJzjT_AtoyWphFzOYmCzqy3T4AJk9k_b9xzFcAQfMEOKkwddEIxMnY71XLg6ubEMj9qKem2ma8Co/s638/double-buffering-in-computer-graphics.jpg&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;double buffering in computer graphics,double buffering in c graphics,double buffering,double buffering in cg&quot; border=&quot;0&quot; data-original-height=&quot;479&quot; data-original-width=&quot;638&quot; height=&quot;480&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhc7atvIb3ungczWUtSjfNFxXVolewCriP3CAv3HX4i6TP95wCiaYlnYvmGXiW1WKbJJJzjT_AtoyWphFzOYmCzqy3T4AJk9k_b9xzFcAQfMEOKkwddEIxMnY71XLg6ubEMj9qKem2ma8Co/w640-h480/double-buffering-in-computer-graphics.jpg&quot; title=&quot;Double Buffering In Computer Graphics&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt;Image Source - Google | Image By - &lt;a href=&quot;https://www.slideshare.net/vasumathi982/animation-54160406&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;slideshare&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;• The idea of maintaining 2 images, one to show and one to build or alter is called double buffering.&lt;/span&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Eg - word file&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Rename Segment&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;rename_segment (old_seg, new_seg)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;If (old_seg &amp;lt; 1 or new_seg &amp;lt; 1 or old_seg &amp;gt; num_seg or &lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;new_seg &amp;gt; num_seg) then&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;Error: &quot;Invalid segment name&quot;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;If now_open&amp;nbsp; = old_seg or now_open = new_seg then&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;Error: &quot;Segment open&quot;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;If seg_size [new_seg] &amp;gt; 0 then&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;Error: &quot;Segment already exists&quot;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;seg_start [new_seg] = seg_start [old_seg]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;seg_size [new_seg] = seg_size [old_seg]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;visibility [new_seg] = visibility [old_seg]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;trans_x [new_seg] = trans_x [old_seg]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;trans_y [new_seg] = trans_y [old_seg]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;scale_x [new_seg] = scale_x [old_seg]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;scale_y [new_seg] = scale_y [old_seg]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;angle [new_seg] = angle [old_seg]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;seg_size [old_seg] = 0&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Set Visibility&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;set_visibility (seg_name)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;If seg_name &amp;lt; 1 or seg_name &amp;gt; num_seg&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;Error: &quot;Invalid segment name&quot;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;visibility [seg_name] = 0 / 1&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;If visibility [seg_name] = 0 then&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;new_frame();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Set Transform&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;set_transform (seg_name, tx, ty, sx, sy, a)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;If seg_name &amp;lt; 1 or seg_name &amp;gt; num_seg&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;Error: &quot;Invalid segment name&quot;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;trans_x [seg_name] = tx&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;trans_y [seg_name] = ty&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;scale_x [seg_name] = sx&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;scale_y [seg_name] = sy&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;angle [seg_name] = a&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;If visibility [seg_name] = 1 then&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;new_frame();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Build Transform&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;build_transform (seg_name)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;If seg_name &amp;lt; 1 or If seg_name &amp;gt; num_seg&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;Error: &quot;Invalid segment name&quot;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;identity_matrix ()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;scaling (scale_x [seg_name], scale_y [seg_name], h)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;rotation (theta [seg_name], h)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;translation (trans_x [seg_name], trans_y [seg_name], h)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Seg_name is not specified as only 1 segment will be opened.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;putpoint (op, x, y)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;If (free &amp;gt; df_size) then&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;Error: &quot;Display file full&quot;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;seg_size [now_open] += 1&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;df_op [free] = op&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;df_x [free] = x&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;df_y [free] = y&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;free ++&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;make_pic_current ()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;If (erase_flag == 1) then&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;erase ();&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;erase_flag = 0&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;for (i = 0 to num_seg)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;If (seg_size [i] != 0 &amp;amp; visibility == 1) then&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;build_transform (i)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;interpret (seg_start [i], seg_size [i]);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;delete_seg (0)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2020/12/segments-in-computer-graphics.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;Segments In Computer Graphics&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2020/12/given-a-clipping-window-p-20-20-q-60-20-r-60-40-and-s-20-40-use-cohan-sutherland-to-determine-the-visible-portion-of-the-line-a-40-80-and-b-120-30.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;Cohen Sutherland In Computer Graphics&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Comment your views on this Article :)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;Thank you for visiting my blog :)&lt;/span&gt;&lt;/h2&gt;&lt;div&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://techfreakforu.blogspot.com/feeds/4637469579371068881/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://techfreakforu.blogspot.com/2020/12/double-buffering-in-computer-graphics.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/4637469579371068881'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/4637469579371068881'/><link rel='alternate' type='text/html' href='https://techfreakforu.blogspot.com/2020/12/double-buffering-in-computer-graphics.html' title='Double Buffering In Computer Graphics'/><author><name>Shubhank Shah</name><uri>http://www.blogger.com/profile/14127870435464846441</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmTbp8ZD9aPrsPr-snD4qfX_2SxjEvesdx4MVlpFmGFMF6U0kcCEKDPdKY3e9-TLxDjOor67Lq3IXtH-lC-IYsseQ85OQGVP_J6851CyJdTd-e79qVW4QM1XK8h09eeWo/s124/WhatsApp+Image+2020-06-15+at+1.30.36+PM.jpeg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhc7atvIb3ungczWUtSjfNFxXVolewCriP3CAv3HX4i6TP95wCiaYlnYvmGXiW1WKbJJJzjT_AtoyWphFzOYmCzqy3T4AJk9k_b9xzFcAQfMEOKkwddEIxMnY71XLg6ubEMj9qKem2ma8Co/s72-w640-h480-c/double-buffering-in-computer-graphics.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5267022146033422138.post-8619452161708958882</id><published>2020-12-08T21:37:00.002+05:30</published><updated>2021-06-30T11:17:24.713+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Tech Guide"/><title type='text'>Segments In Computer Graphics</title><content type='html'>&lt;h1 style=&quot;text-align: left;&quot;&gt;&amp;nbsp;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Segments&lt;/span&gt;&lt;/h1&gt;&lt;div&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiHlElUuAiZp-uIFCGysj6zBekJOD6m_vzrAnanmzmidrqyZyCncQ_yrxD4EwrSZmkXunwr6l4yvV7AzsXygpREsxHmpelH6KWbetMSWUcqq_FTWX0Nxbv22LtgF4PVaIf6AjAb-lvGx1t/s642/segments-in-computer-graphics.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;segments in computer graphics,segments in c graphics,segments,segments in cg&quot; border=&quot;0&quot; data-original-height=&quot;448&quot; data-original-width=&quot;642&quot; height=&quot;446&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiHlElUuAiZp-uIFCGysj6zBekJOD6m_vzrAnanmzmidrqyZyCncQ_yrxD4EwrSZmkXunwr6l4yvV7AzsXygpREsxHmpelH6KWbetMSWUcqq_FTWX0Nxbv22LtgF4PVaIf6AjAb-lvGx1t/w640-h446/segments-in-computer-graphics.png&quot; title=&quot;Segments In Computer Graphics&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt;Image Source - Google | Image By -&amp;nbsp;&lt;a href=&quot;https://www.geeksforgeeks.org/segments-computer-graphics/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;geeksforgeeks&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• The segment name is zero then it is called an undefined segment.&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• BD created for a code that is not specified where it belongs then it belongs to zero segments, with no visibility.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Segment name can be integers from 1 to max number.&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Create Segment&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;create_segment (seg_name)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;variables:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;now_open (global val = 0), num_seg, seg_start [num_seg], &lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;seg_size [num_seg], trans_x [num_seg], visibility [num_seg], &lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;trans_y [num_seg], angle [num_seg], scale [num_seg], free&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;If now_open &amp;gt; 0 then,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;Error: &quot;Segment already opened&quot;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;If seg_name &amp;lt; 1 or seg_name &amp;gt; num_seg then,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;Error: &quot;Invalid segment name&quot;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;If seg_size [seg_name] &amp;gt; 0 then,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;Error: &quot;Segment already exists&quot;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;seg_start [seg_name] = free&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;seg_size [seg_name] = 0&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;visibility [seg_name] = visibility [0]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;trans_x [seg_name] = trans_x [0]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;trans_y [seg_name] = trans_y [0]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;scale_x [seg_name] = scale_x [0]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;scale_y [seg_name] = scale_y [0]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;angle [seg_name] = angle [0]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;now_open = seg_name&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Close Segment&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;close_segment ()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;If now_open&amp;nbsp; = 0 then,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;Error: &quot;Segment already closed&quot;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;delete_seg (0)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;seg_start [0] = free&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;seg_size [0] = 0&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;now_open = 0&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Delete Segment&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;delete_segment (seg_name)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;If (seg_name &amp;lt; 1 or seg_name &amp;gt; num_seg) then,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;Error: &quot;Invalid segment name&quot;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;If now_open = seg_name then,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;Error: &quot;Segment open&quot;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;If seg_size [seg_name] = 0 then,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;Error: &quot;Segment doesn&#39;t exists&quot;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;put = seg_start [seg_name]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;size = seg_size [seg_name]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;get = put + size&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;while (get &amp;lt; free)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;df_op [put] = df_op [get]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;df_x [put] = df_x [get]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;df_y [put] = df_y [get]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;put ++&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;get ++&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;free = put&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;for (i = 0 to num_seg)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;if (seg_start [i] &amp;gt; seg_start [seg_name])&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;seg_start [i] = seg_start [i] - size&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;seg_size [seg_name] = 0&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;if (visibility [seg_name] == 1) then,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;new_frame ()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Delete All&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;delete_all ()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;for (i = 0 to num_seg)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;seg_start [i] = 1&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;seg_size [i] = 0&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;free = 1&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;now_open = 0&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;new_frame ()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2020/12/liang-barsky-line-clipping-algorithm.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;Liang Barsky Algorithm In Computer Graphics&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: xx-large;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2020/12/double-buffering-in-computer-graphics.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;Double Buffering In Computer Graphics&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Comment your views on this Article :)&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;Thank you for visiting my blog :)&lt;/span&gt;&lt;/h2&gt;&lt;div&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://techfreakforu.blogspot.com/feeds/8619452161708958882/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://techfreakforu.blogspot.com/2020/12/segments-in-computer-graphics.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/8619452161708958882'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/8619452161708958882'/><link rel='alternate' type='text/html' href='https://techfreakforu.blogspot.com/2020/12/segments-in-computer-graphics.html' title='Segments In Computer Graphics'/><author><name>Shubhank Shah</name><uri>http://www.blogger.com/profile/14127870435464846441</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmTbp8ZD9aPrsPr-snD4qfX_2SxjEvesdx4MVlpFmGFMF6U0kcCEKDPdKY3e9-TLxDjOor67Lq3IXtH-lC-IYsseQ85OQGVP_J6851CyJdTd-e79qVW4QM1XK8h09eeWo/s124/WhatsApp+Image+2020-06-15+at+1.30.36+PM.jpeg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiHlElUuAiZp-uIFCGysj6zBekJOD6m_vzrAnanmzmidrqyZyCncQ_yrxD4EwrSZmkXunwr6l4yvV7AzsXygpREsxHmpelH6KWbetMSWUcqq_FTWX0Nxbv22LtgF4PVaIf6AjAb-lvGx1t/s72-w640-h446-c/segments-in-computer-graphics.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5267022146033422138.post-2353877524800317075</id><published>2020-12-07T19:26:00.003+05:30</published><updated>2021-06-30T11:17:55.577+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Tech Guide"/><title type='text'>Liang Barsky Line Clipping Algorithm In Computer Graphics</title><content type='html'>&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Liang Barsky Algorithm&lt;/span&gt;&lt;/h1&gt;&lt;div&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUQkVAAhzzJfn02OcUjVxWXN0a4i4HKPThfcmRs94GAwlGgKzJT9skLP2aGCFeCQu5EjdKzupWSP-WppvUv_VP6QvxLWomxeqjZqcxMD9r-wl1ecLKcJRE72XZRKqDZbS3lxOsuM2LETNz/s649/liang-barsky-line-clipping-algorithm.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;liang barsky algorithm,liang barsky line clipping algorithm,liang barsky algorithm in computer graphics,liang barsky line clipping algorithm in computer graphics&quot; border=&quot;0&quot; data-original-height=&quot;512&quot; data-original-width=&quot;649&quot; height=&quot;504&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUQkVAAhzzJfn02OcUjVxWXN0a4i4HKPThfcmRs94GAwlGgKzJT9skLP2aGCFeCQu5EjdKzupWSP-WppvUv_VP6QvxLWomxeqjZqcxMD9r-wl1ecLKcJRE72XZRKqDZbS3lxOsuM2LETNz/w640-h504/liang-barsky-line-clipping-algorithm.png&quot; title=&quot;Liang Barsky Algorithm&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt;Image Source - Google | Image By -&amp;nbsp;&lt;a href=&quot;http://www.pracspedia.com/CG/liangbarsky.html&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;pracspedia&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;•&amp;nbsp;Parametric equation of line is given by,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt;&lt;p&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;x = x1 + (x2 - x1) * u&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;y = y1 + (y2 - y1) * u&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Where, 0 &amp;lt;= u &amp;lt;= 1&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;x2 - x1 = delta x&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;y2 - y1 = delta y&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Replacing this values in equation,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;x = x1 + u * delta x&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;y = y1 + u * delta y&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• The point clipping condition can be written in parametric form as,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;xwmin &amp;lt;= x1 + delta x * u &amp;lt;= xwmax&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;ywmin &amp;lt;= y1 + delta y * u &amp;lt;= ywmax&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Each of this 4 inequality is represented as,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;u * pk &amp;lt;= qk, k = 1, 2, 3, 4&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Where,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;p1 = - delta x, q1 = x1 - xwmin&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;p2 = delta x, q2 = xwmax - x1&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;p3 = - delta y, q3 = y1 - ywmin&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;p4 = delta y, q4 = ywmax - y1&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Any line i.e parallel to one of the clipping boundry has pk = 0.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• If for that value of k, we get qk &amp;lt; 0 then line is completely outside the window &amp;amp; can be eliminated if qk &amp;gt;= 0, the line is parallel to the window.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• When pk &amp;lt; 0 the line is from outside to inside if pk &amp;gt; 0, the line is from inside to outside for non - zero value of pk, we can calculate u = qk / pk.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• For each line we calculate u1 &amp;amp; u2,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;The value of u1 is determinded for the line which proceeds from outside to inside p &amp;lt; 0, for this we calculate rk = qk / pk.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• The value of u1 is taken as the largest of the r value.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Conversely, the value of u2 is determined for the line which proceeds from inside to outside (p &amp;gt; 0).&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Again Rk is calculated and u2 is the minimum of r value.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• If u1 &amp;gt; u2, the line is completely outside &amp;amp; rejected otherwise endpoints are calculated using parameter u.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Initialize u1 &amp;amp; u2 to 0 and 1 respectively.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• For each boundry calculate p &amp;amp; q, if p &amp;lt; 0.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• R is used to update otherwise if p &amp;gt; 0, r is used to update u2 if updating u1 &amp;amp; u2 results in u1 &amp;gt; u2.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• We reject the line otherwise we update u.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• If p = 0 &amp;amp; q &amp;lt; 0, we discard the line since it is parallel &amp;amp; outside the window.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• The endpoints are calculated using parameter u1 &amp;amp; u2.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Clipline (x1, y1, x2, y2, xwmin, xwmax, ywmin, ywmax)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;u1 = 0.0, u2 = 1.0&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;dx = x2 - x1 ,dy = y2 - y1&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;if (cliptest (-dx, x1 - xwmin, u1, u2))&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;if (cliptest (dx, xwmax - x1, u1, u2))&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;if (cliptest (-dy, y1 - ywmin, u1, u2))&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;if (cliptest (dy, ywmin - y1, u1, u2))&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;if (u2 &amp;lt; 1.0)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;x2 = x1 + u2 * dx&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;y2 = y1 + u2 * dy&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;if (u1 &amp;gt; 0.0)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;x1 = x1 + u1 * dx&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;y1 = y1 + u1 * dy&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;bresenham (round (x1), round (y1), round (x2), round (y2))&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Cliptest (p, q, u1, u2)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;retvalue = true&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;if (p &amp;lt; 0)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;r = q / p&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;if (r &amp;gt; u2)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;retvalue = false&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;else&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;if (r &amp;gt; u1)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;u1 = r&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;else if (p &amp;gt; 0)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;r = q / p&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;if (r &amp;lt; u1)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;retvalue&amp;nbsp; = false&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;else if (r &amp;lt; u2)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;u2&amp;nbsp; = r&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;else&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;if (q &amp;lt; 0)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;retvalue&amp;nbsp; = false&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;return (retvalue);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2020/12/explain-in-detail-2d-rotation-along-with-diagram.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;2-D Rotation In Computer Graphics&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2020/12/segments-in-computer-graphics.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;Segments In Computer Graphics&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Comment your views on this Article :)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: xx-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;Thank you for visiting my blog :)&lt;/span&gt;&lt;/h2&gt;&lt;div&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://techfreakforu.blogspot.com/feeds/2353877524800317075/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://techfreakforu.blogspot.com/2020/12/liang-barsky-line-clipping-algorithm.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/2353877524800317075'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/2353877524800317075'/><link rel='alternate' type='text/html' href='https://techfreakforu.blogspot.com/2020/12/liang-barsky-line-clipping-algorithm.html' title='Liang Barsky Line Clipping Algorithm In Computer Graphics'/><author><name>Shubhank Shah</name><uri>http://www.blogger.com/profile/14127870435464846441</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmTbp8ZD9aPrsPr-snD4qfX_2SxjEvesdx4MVlpFmGFMF6U0kcCEKDPdKY3e9-TLxDjOor67Lq3IXtH-lC-IYsseQ85OQGVP_J6851CyJdTd-e79qVW4QM1XK8h09eeWo/s124/WhatsApp+Image+2020-06-15+at+1.30.36+PM.jpeg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUQkVAAhzzJfn02OcUjVxWXN0a4i4HKPThfcmRs94GAwlGgKzJT9skLP2aGCFeCQu5EjdKzupWSP-WppvUv_VP6QvxLWomxeqjZqcxMD9r-wl1ecLKcJRE72XZRKqDZbS3lxOsuM2LETNz/s72-w640-h504-c/liang-barsky-line-clipping-algorithm.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5267022146033422138.post-1828634968818884792</id><published>2020-12-04T18:31:00.002+05:30</published><updated>2021-06-30T11:19:45.735+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Tech Guide"/><title type='text'>Explain In Detail 2D Rotation Along With Diagram</title><content type='html'>&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;2 - D Rotation&lt;/span&gt;&lt;/h1&gt;&lt;div&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghseT_jwX0ib-vBAMUDbr118V7f3tap1ltEZgaepQV6yvdoXypLKY-tE-sO4_jZS5EZir35U31DLILul8L1XOxMLZJ-xp5BPUfPZgn856f4wPM6uc640jTBOutlDz2sHeJSrQF16vXTG2r/s424/explain-in-detail-2d-rotation-along-with-diagram.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;2d rotation in computer graphics,2d rotation in c graphics,explain in detail 2d rotation along with diagram,explain in detail 2d rotation in computer graphics&quot; border=&quot;0&quot; data-original-height=&quot;331&quot; data-original-width=&quot;424&quot; height=&quot;500&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghseT_jwX0ib-vBAMUDbr118V7f3tap1ltEZgaepQV6yvdoXypLKY-tE-sO4_jZS5EZir35U31DLILul8L1XOxMLZJ-xp5BPUfPZgn856f4wPM6uc640jTBOutlDz2sHeJSrQF16vXTG2r/w640-h500/explain-in-detail-2d-rotation-along-with-diagram.png&quot; title=&quot;Explain In Detail 2D Rotation Along With Diagram&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;span style=&quot;font-size: x-large;&quot;&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt;•&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt;A two-dimensional rotation is applied to an object by repositioning it along a circular path in the XY plane.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• To generate a rotation, we specify a rotation angle θ and the position (x, y) of the rotation point (or pivot point) about which the object is to be rotated (Fig. 5-3).&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Positive values for the rotation angle define counterclockwise rotations about the pivot point, as in Fig. 5-3, and negative values rotate objects in the clockwise direction.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• This transformation can also be described as a rotation about a rotation axis that is perpendicular to the XY plane and passes through the pivot point.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• We first determine the transformation equations for rotation of a point position P when the pivot point is at the coordinate origin.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• The angular and coordinate relationships of the original and transformed point positions are shown in Fig. 5-4.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• In this figure, r is the constant distance of the point from the origin, angle&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Φ is the original angular position of the point from the horizontal, and θ is the rotation angle.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Using standard trigonometric identities, we can express the transformed&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;coordinates in terms of angles θ and Φ as:&lt;/span&gt;&lt;span style=&quot;font-family: helvetica; font-size: xx-large;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Figure (5.4)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;x&#39; = r cos (Φ + θ) = r cosΦ cosθ - r sinΦ sinθ&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;y&#39; = r sin (Φ + θ) = r cosΦ sinθ - r sinΦ cosθ&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• The original coordinates of the point in polar coordinates are&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Figure (5.5)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;x = r cos Φ, y = r sin Φ&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Substituting expressions 5-5 into 5-4, we obtain the transformation equations for rotating a point at position (x, y) through an angle θ about the origin:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Figure (5.6)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;x&#39; = xcosθ - ysinθ&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;y&#39; = xsinθ + y cosθ&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• With the column-vector representations 5-2 for coordinate positions, we can write the rotation equations in the matrix form:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Figure (5.7)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;P&#39; = R * P&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Where the rotation matrix is:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Figure (5.8)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;R= [ [cosθ - sinθ] [sinθ cosθ] ]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• When coordinate positions are represented as row vectors instead of column vectors, the matrix product in rotation equation 5-7 is transposed so that the transformed row coordinate vector |x&#39; y&#39;| is calculated as&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp;P&#39;t = (R * P) t&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; = Pt * Rt&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Where PT = [x y], and the transpose RT of matrix R is obtained by interchanging rows and columns.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• For a rotation matrix, the transpose is obtained by simply changing the sign of the sine terms.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• The rotation of a point about an arbitrary pivot position is illustrated in Fig. 5-5.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Using the trigonometric relationships in this figure, we can generalize Eqs. 5-6 to obtain the transformation equations for rotation of a point about any specified position (x,,!~,):&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Figure (5.9)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;X &#39; = X, + (a - x,) cos&amp;nbsp;θ - (y - y,) sin&amp;nbsp;θ&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Y&#39; = Y, + (1 - v,) sin&amp;nbsp;θ + (y - y,) cos&amp;nbsp;θ&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• These general rotation equations differ from Eqs. 5-6 by the inclusion of additive terms, as well as the multiplicative factors on the coordinate values.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Thus, the matrix expression 5-7 could be modified to include: pivot coordinates by matrix addition of a column vector whose elements contain the additive (translational) terms In Eqs. 5-9.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• There are better ways, however, to formulate such matrix equations, and we discuss in Section 5-2 a more consistent scheme for representing the&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;transformation equations.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• As with translations, rotations are rigid-body transformations that move&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;objects without deformation.&lt;/span&gt;&lt;span style=&quot;font-family: helvetica; font-size: xx-large;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Every point on an object is rotated at the same angle.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• A straight line segment is rotated by applying the rotation equations 5-9 to each of those&#39; line endpoints and redrawing the line between the new endpoint positions.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Polygons are rotated by displacing each vertex through the specified rotation angle and regenerating the polygon using the new vertices.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Curved lines arc rotated by repositioning the defining p ~ r ~atnsd redrawing the curves.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• A circle k&amp;gt;r,117 ellipses, for instance, can be rotated about a noncentral axis by moving the center position through the arc that substances the specified rotation angle.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• An ellipse can be rotated about its center coordinates by rotating the major and minor axis.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2020/12/explain-the-concept-of-char-up-direction-in-text-printing-with-an-example.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;Concept of Char_Up Vector In Computer Graphics&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2020/12/liang-barsky-line-clipping-algorithm.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;Liang Barsky Algorithm&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Comment your views on this Article :)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;Thank you for visiting my blog :)&lt;/span&gt;&lt;/h2&gt;&lt;div&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://techfreakforu.blogspot.com/feeds/1828634968818884792/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://techfreakforu.blogspot.com/2020/12/explain-in-detail-2d-rotation-along-with-diagram.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/1828634968818884792'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/1828634968818884792'/><link rel='alternate' type='text/html' href='https://techfreakforu.blogspot.com/2020/12/explain-in-detail-2d-rotation-along-with-diagram.html' title='Explain In Detail 2D Rotation Along With Diagram'/><author><name>Shubhank Shah</name><uri>http://www.blogger.com/profile/14127870435464846441</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmTbp8ZD9aPrsPr-snD4qfX_2SxjEvesdx4MVlpFmGFMF6U0kcCEKDPdKY3e9-TLxDjOor67Lq3IXtH-lC-IYsseQ85OQGVP_J6851CyJdTd-e79qVW4QM1XK8h09eeWo/s124/WhatsApp+Image+2020-06-15+at+1.30.36+PM.jpeg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghseT_jwX0ib-vBAMUDbr118V7f3tap1ltEZgaepQV6yvdoXypLKY-tE-sO4_jZS5EZir35U31DLILul8L1XOxMLZJ-xp5BPUfPZgn856f4wPM6uc640jTBOutlDz2sHeJSrQF16vXTG2r/s72-w640-h500-c/explain-in-detail-2d-rotation-along-with-diagram.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5267022146033422138.post-9075229158537622629</id><published>2020-12-03T18:59:00.002+05:30</published><updated>2021-06-30T11:20:26.933+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Tech Guide"/><title type='text'>Explain The Concept of Char_Up Direction In Text Printing With An Example</title><content type='html'>&lt;h1 style=&quot;text-align: left;&quot;&gt;&amp;nbsp;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Character Up&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• The orientation for a displayed character string is set according to the direction of the character up vector.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• char_up (x, y)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Parameter in the function is assigned two values for x and y value components.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Text is then displayed so that the orientation of character from baseline to topline is in the direction of the &quot;up vector&quot;.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• E.x - char_up (1, 1) the direction is in the up vector is 45 degree and text would be displayed as given below:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGjhxDwJ4hy_5-f9zy9-2oN4ZitEhdCwkd0ixZKqZrwkTWzTNf05B1HKWm_TY7q2AWPXFDxkl4hVs3PPTwXQ88hCzepaSmUbeux_tw-5NEP7bqGEcyIBb0U_KbJLHX_4vOc7KdgE94yKzh/s469/explain-the-concept-of-char-up-direction-in-text-printing-with-an-example.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Explain The Concept of Char_Up Direction In Text Printing With An Example,Concept of Char_Up Vector in Computer Graphics,char_up vector in text printing&quot; border=&quot;0&quot; data-original-height=&quot;402&quot; data-original-width=&quot;469&quot; height=&quot;548&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGjhxDwJ4hy_5-f9zy9-2oN4ZitEhdCwkd0ixZKqZrwkTWzTNf05B1HKWm_TY7q2AWPXFDxkl4hVs3PPTwXQ88hCzepaSmUbeux_tw-5NEP7bqGEcyIBb0U_KbJLHX_4vOc7KdgE94yKzh/w640-h548/explain-the-concept-of-char-up-direction-in-text-printing-with-an-example.png&quot; title=&quot;Concept of Char_Up Vector in Computer Graphics&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• A producer for orienting text rotates character so that the side of character bodies, from baseline to cap line is aligned with the up vector.&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Routine Instructions&amp;nbsp;&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;setcharup (dx, dy)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;s = sqrt (pow (dx, 2) + pow (dy, 2))&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;if (s &amp;lt; roundoff) then&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Error: &quot;Very Small Value&quot;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;ds = (abs (cw * dy) + abs (ch * dx)) / s&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;ts = ds * (1 + charsep)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;xcharsp = ts * (dy / s)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;ycharsp = ts * (-dx / s)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;text (String)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;len = strlen (String);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;x = df - penx;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;y = df - peny;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;for (i = 1 to len)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;chr = String [i]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;op = chr&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;op = -op&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;dis_file_enter (op);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;df_penx += xcharsp&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;df_peny += ycharsp&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;move_abs (x, y)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;interpret (start, count)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;for (n = start to count)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;getpoint (n, op, x, y);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;if (op &amp;lt; -31 &amp;amp;&amp;amp; op &amp;gt; -127)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;dochar (op, x, y);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;else if (op == 1)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;domove (x, y);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;else if (op == 2)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;doline (x, y);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;else&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&quot;op code error&quot;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;dochar (op, x, y)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;frame_penx = max (ws, min (we, x * w + ws))&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;frame_peny = max (hs, min (he, y * h + hs))&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;op = -op&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;chr = op&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;switch (chr)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;case &#39;h&#39; : genh (frame_penx, frame_peny);&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;case &#39;e&#39; : genh (frame_penx, frame_peny);&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;case &#39;l&#39; : genh (frame_penx, frame_peny);&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;case &#39;l&#39; : genh (frame_penx, frame_peny);&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;case &#39;o&#39; : genh (frame_penx, frame_peny);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;initialize ()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;old initialize ()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;ch = 0.1;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;cw = 0.1;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;char_sep = 0;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;set_charup (1, 0) / (0, 1);&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;main ()&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;char_string [5] = {&#39;h&#39;,&#39;e&#39;,&#39;l&#39;,&#39;l&#39;,&#39;o&#39;};&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;initialize ();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;new_frame ();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;text (string);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;make_picture_current ();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2020/12/illustrate-bresenham-algorithm-for-calculating-the-points-for-line-having-endpoints-17-to-59.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;Illustrate the Bresenham Algorithm For Endpoints (-1, 7) to (5, 9)&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2020/12/explain-in-detail-2d-rotation-along-with-diagram.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;Concept of 2D Rotation In Computer Graphics&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Comment your views on this Article :)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;Thank you for visiting my blog :)&lt;/span&gt;&lt;/h2&gt;&lt;div&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://techfreakforu.blogspot.com/feeds/9075229158537622629/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://techfreakforu.blogspot.com/2020/12/explain-the-concept-of-char-up-direction-in-text-printing-with-an-example.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/9075229158537622629'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/9075229158537622629'/><link rel='alternate' type='text/html' href='https://techfreakforu.blogspot.com/2020/12/explain-the-concept-of-char-up-direction-in-text-printing-with-an-example.html' title='Explain The Concept of Char_Up Direction In Text Printing With An Example'/><author><name>Shubhank Shah</name><uri>http://www.blogger.com/profile/14127870435464846441</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmTbp8ZD9aPrsPr-snD4qfX_2SxjEvesdx4MVlpFmGFMF6U0kcCEKDPdKY3e9-TLxDjOor67Lq3IXtH-lC-IYsseQ85OQGVP_J6851CyJdTd-e79qVW4QM1XK8h09eeWo/s124/WhatsApp+Image+2020-06-15+at+1.30.36+PM.jpeg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGjhxDwJ4hy_5-f9zy9-2oN4ZitEhdCwkd0ixZKqZrwkTWzTNf05B1HKWm_TY7q2AWPXFDxkl4hVs3PPTwXQ88hCzepaSmUbeux_tw-5NEP7bqGEcyIBb0U_KbJLHX_4vOc7KdgE94yKzh/s72-w640-h548-c/explain-the-concept-of-char-up-direction-in-text-printing-with-an-example.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5267022146033422138.post-3889622818289983541</id><published>2020-12-02T19:22:00.005+05:30</published><updated>2021-06-30T11:21:00.209+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Tech Guide"/><title type='text'>Illustrate Bresenham Algorithm For Calculating The Points For Line Having Endpoints (-1, 7) to (5, 9)</title><content type='html'>&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Points -&amp;gt; (-1, 7) to (5, 9)&amp;nbsp;&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Bresenham (-1, 7, 5, 9)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;dx = abs (-1 - 5) = 6&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;dy = abs (7 - 9) = 2&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;m = (float) (9 - 7) / (5 - ( - 1)) = 0.33&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;if (6 &amp;gt;2) then&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;p = 2 * 2 - 6 = -2&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;twody = 2 * 2 = 4&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;twodydx = 2 * (2 - 6) = -8&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;if (-1 &amp;gt; 5) false&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;else&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;x = xa = -1&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;y = ya = 7&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;xend = xb = 5&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;putpixel (-1, 7, 3)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;while (-1 &amp;lt; 5)&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;x = 0 // x++;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;if (-2 &amp;lt; 0) then&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;p = -2 + 4 // p = p + twody&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;putpixel (0, 7, 1)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;while (0 &amp;lt; 5)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;x = 1 // x++;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;if (2 &amp;lt; 0) false&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;else&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;if (0 &amp;lt; 0.33 &amp;amp;&amp;amp; 0.33 &amp;lt; 1) then&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;y = 8 // y++;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;p = 2 + (-8) = -6 // p = p + twodydx&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;putpixel (1, 8, 2)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;while (1 &amp;lt; 5)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;x = 2 // x++;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;if (-6 &amp;lt; 0) then&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;p = -6 + 4 = -2 // p = p + twody&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;putpixel (2, 8, 4)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;while (2 &amp;lt; 5)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;x = 3 // x++;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;if (-2 &amp;lt; 0) then&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;p = -2 + 4 = 2 // p = p + twody&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;putpixel (3, 8, 1)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;while (3 &amp;lt; 5)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;x = 4 // x++;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;if (2 &amp;lt; 0) false&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;else&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;if (0 &amp;lt; 0.33 &amp;amp;&amp;amp; 0.33 &amp;lt; 1) then&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;y = 9 // y++;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;p = 2 + (-8) = -6 // p = p + twodydx&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;putpixel (4, 9, 1)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;while (4 &amp;lt; 5)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;x = 5 // x++;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;if (-6 &amp;lt; 0) then&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;p = -6 + 4 = -2 // p = p + twody&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;putpixel (5, 9, 1)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Putpixel&lt;/span&gt;&lt;/h1&gt;&lt;div&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEKwMKEknoDP7O9l6Z7xqyT1CxJl5rI0FbeqbECZc8AVvUPN0mVhWLlMdTB3uUnVB6BFLvpLLKWn1jQ8gVIzSYonFrMc4SD_8sC2t8k1LY9I53GVfADNNeyIZ4_fFquZ7dz0zqI-ItzKLf/s560/illustrate-bresenham-algorithm-for-calculating-the-points-for-line-having-endpoints-17-to-59.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Illustrate Bresenham algorithm for calculating the points for line having endpoints (-1, 7) to (5, 9),bresenham algorithm illustration&quot; border=&quot;0&quot; data-original-height=&quot;560&quot; data-original-width=&quot;397&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEKwMKEknoDP7O9l6Z7xqyT1CxJl5rI0FbeqbECZc8AVvUPN0mVhWLlMdTB3uUnVB6BFLvpLLKWn1jQ8gVIzSYonFrMc4SD_8sC2t8k1LY9I53GVfADNNeyIZ4_fFquZ7dz0zqI-ItzKLf/w454-h640/illustrate-bresenham-algorithm-for-calculating-the-points-for-line-having-endpoints-17-to-59.png&quot; title=&quot;Illustrate Bresenham algorithm for calculating the points for line having endpoints (-1, 7) to (5, 9)&quot; width=&quot;454&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2020/12/write-a-java-program-that-has-a-class-called-number-system-make-functions-for-tobinary-tooctal-tohexadecimal.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;Number System In Java&lt;/a&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;div&gt;&lt;span style=&quot;background-color: #cfe2f3; font-family: helvetica;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2020/12/explain-the-concept-of-char-up-direction-in-text-printing-with-an-example.html&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;Concept of Char_Up Vector In Computer Graphics&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: helvetica; font-size: xx-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;Comment your views on this Article :)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: helvetica; font-size: xx-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: helvetica; font-size: xx-large;&quot;&gt;&lt;h2 style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;Thank you for visiting my blog :)&lt;/span&gt;&lt;/h2&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://techfreakforu.blogspot.com/feeds/3889622818289983541/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://techfreakforu.blogspot.com/2020/12/illustrate-bresenham-algorithm-for-calculating-the-points-for-line-having-endpoints-17-to-59.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/3889622818289983541'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/3889622818289983541'/><link rel='alternate' type='text/html' href='https://techfreakforu.blogspot.com/2020/12/illustrate-bresenham-algorithm-for-calculating-the-points-for-line-having-endpoints-17-to-59.html' title='Illustrate Bresenham Algorithm For Calculating The Points For Line Having Endpoints (-1, 7) to (5, 9)'/><author><name>Shubhank Shah</name><uri>http://www.blogger.com/profile/14127870435464846441</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmTbp8ZD9aPrsPr-snD4qfX_2SxjEvesdx4MVlpFmGFMF6U0kcCEKDPdKY3e9-TLxDjOor67Lq3IXtH-lC-IYsseQ85OQGVP_J6851CyJdTd-e79qVW4QM1XK8h09eeWo/s124/WhatsApp+Image+2020-06-15+at+1.30.36+PM.jpeg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEKwMKEknoDP7O9l6Z7xqyT1CxJl5rI0FbeqbECZc8AVvUPN0mVhWLlMdTB3uUnVB6BFLvpLLKWn1jQ8gVIzSYonFrMc4SD_8sC2t8k1LY9I53GVfADNNeyIZ4_fFquZ7dz0zqI-ItzKLf/s72-w454-h640-c/illustrate-bresenham-algorithm-for-calculating-the-points-for-line-having-endpoints-17-to-59.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5267022146033422138.post-314070100258146006</id><published>2020-12-01T22:15:00.002+05:30</published><updated>2021-06-30T11:21:48.795+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Tech Guide"/><title type='text'>Write a Java Program That Has a Class Called Number System</title><content type='html'>&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Number System&lt;/span&gt;&lt;/h1&gt;&lt;div&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwNCMNS2r2uvwWe6OJdzITszzgbBHbAtZ45ai8d_PR_WZt3e0HwGRwpaJlafBx9W8A3CjtrNUgSLJVvG9Qx_zoVsLkolrMWJSVymsWohXUS0cx9JepV53Sy9JepY8Uge-imlW9gRT5xQl6/s497/write-a-java-program-that-has-a-class-called-number-system-make-functions-for-tobinary-tooctal-tohexadecimal.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;write a java program that has a class called number system,write a java program that has a class called number system make functions for tobinary tooctal tohexadecimal&quot; border=&quot;0&quot; data-original-height=&quot;338&quot; data-original-width=&quot;497&quot; height=&quot;436&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwNCMNS2r2uvwWe6OJdzITszzgbBHbAtZ45ai8d_PR_WZt3e0HwGRwpaJlafBx9W8A3CjtrNUgSLJVvG9Qx_zoVsLkolrMWJSVymsWohXUS0cx9JepV53Sy9JepY8Uge-imlW9gRT5xQl6/w640-h436/write-a-java-program-that-has-a-class-called-number-system-make-functions-for-tobinary-tooctal-tohexadecimal.png&quot; title=&quot;Write a Java Program That Has a Class Called Number System&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;import java.util.Scanner;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;class Numbersystem{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;void toBinary(int n){&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;System.out.println(Integer.toBinaryString(n));&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;void toOctal(int n){&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;System.out.println(Integer.toOctalString(n));&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;void toHexadecimal(int n){&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;System.out.println(Integer.toHexString(n));&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;class Q7{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;public static void main(String args[]){&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;Numbersystem s=new Numbersystem();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;int n;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;Scanner sc=new Scanner(System.in);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;System.out.println(&quot;\nEnter decimal value: &quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;n=sc.nextInt();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;if(n&amp;lt;0 || n&amp;gt;9)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;System.out.println(&quot;Please enter valid decimal number!!&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;else&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;{&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;System.out.println(&quot;\n-------------------------------------------&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;System.out.println(&quot;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ANS&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;System.out.println(&quot;-------------------------------------------&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;System.out.println(&quot;Decimal to Binary:&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;s.toBinary(n);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;System.out.println(&quot;Decimal to Octal:&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;s.toOctal(n);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;System.out.println(&quot;Decimal to Hexadecimal:&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;s.toHexadecimal(n);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;System.out.println(&quot;-------------------------------------------&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;System.out.println(&quot;-------------------------------------------&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2020/11/c-program-of-polygon-relative-in-computer-graphics.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;Polygon Relative In Computer Graphics&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2020/12/illustrate-bresenham-algorithm-for-calculating-the-points-for-line-having-endpoints-17-to-59.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;Bresenham Algorithm for Endpoints (-1, 7) to (5, 9)&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Comment your views on this Article :)&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;h2 style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;Thank you for visiting my blog :)&lt;/span&gt;&lt;/h2&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://techfreakforu.blogspot.com/feeds/314070100258146006/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://techfreakforu.blogspot.com/2020/12/write-a-java-program-that-has-a-class-called-number-system-make-functions-for-tobinary-tooctal-tohexadecimal.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/314070100258146006'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/314070100258146006'/><link rel='alternate' type='text/html' href='https://techfreakforu.blogspot.com/2020/12/write-a-java-program-that-has-a-class-called-number-system-make-functions-for-tobinary-tooctal-tohexadecimal.html' title='Write a Java Program That Has a Class Called Number System'/><author><name>Shubhank Shah</name><uri>http://www.blogger.com/profile/14127870435464846441</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmTbp8ZD9aPrsPr-snD4qfX_2SxjEvesdx4MVlpFmGFMF6U0kcCEKDPdKY3e9-TLxDjOor67Lq3IXtH-lC-IYsseQ85OQGVP_J6851CyJdTd-e79qVW4QM1XK8h09eeWo/s124/WhatsApp+Image+2020-06-15+at+1.30.36+PM.jpeg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwNCMNS2r2uvwWe6OJdzITszzgbBHbAtZ45ai8d_PR_WZt3e0HwGRwpaJlafBx9W8A3CjtrNUgSLJVvG9Qx_zoVsLkolrMWJSVymsWohXUS0cx9JepV53Sy9JepY8Uge-imlW9gRT5xQl6/s72-w640-h436-c/write-a-java-program-that-has-a-class-called-number-system-make-functions-for-tobinary-tooctal-tohexadecimal.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5267022146033422138.post-755016676407089062</id><published>2020-11-30T19:13:00.002+05:30</published><updated>2021-06-30T11:22:25.989+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Tech Guide"/><title type='text'>C Program of Polygon Relative In Computer Graphics</title><content type='html'>&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Program of Polygon Relative&lt;/span&gt;&lt;/h1&gt;&lt;div&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2a2C10yde6uD2LeFv2zGTCaIZmD904_8lGfTCLT0OHCgrwmsjv-phtv5CHrhDZOASHPz775_SDj89NGIp4Ie9kPvcY9NbTPRAhiPfFH8WLA0ZXbel3WgMfbvKtIwBsFg35WWdf3HjgiDi/s809/c-program-of-polygon-relative-in-computer-graphics.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;polygon relative in computer graphics,c program of polygon relative in computer graphics,concept of polygon relative in computer graphics,polygon relative&quot; border=&quot;0&quot; data-original-height=&quot;515&quot; data-original-width=&quot;809&quot; height=&quot;408&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2a2C10yde6uD2LeFv2zGTCaIZmD904_8lGfTCLT0OHCgrwmsjv-phtv5CHrhDZOASHPz775_SDj89NGIp4Ie9kPvcY9NbTPRAhiPfFH8WLA0ZXbel3WgMfbvKtIwBsFg35WWdf3HjgiDi/w640-h408/c-program-of-polygon-relative-in-computer-graphics.png&quot; title=&quot;Polygon Relative In Computer Graphics&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;#include&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;#include&amp;lt;conio.h&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;#include&amp;lt;math.h&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;#include&amp;lt;graphics.h&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;#include&amp;lt;string.h&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;#define size 25&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;#define r(a) (a+0.5)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;int gdriver=DETECT, gmode;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;float df_penx, df_peny, frame_penx, frame_peny, df_op[size], df_x[size], df_y[size];&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;float hs, he, h, we, ws, w, x, y;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;int op,fre,erase_flag=0, x1, y1, n;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;float a_x[]={0.4, 0.23, -0.23, 0.5, -0.23, 0.23};&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;float a_y[]={0.3, 0.2, 0.2, 0.0, -0.2, -0.2};&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;void erase()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;int j;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;for(n=1;n&amp;lt;we+1;n++)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;for(j=1;j&amp;lt;he+1;j++)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;putpixel(n, j, 0);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;void new_frame()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;erase_flag=1;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;void initialize()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;fre=0;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;df_penx=0;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;df_peny=0;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;frame_penx=0;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;frame_peny=0;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;hs=0;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;he=getmaxy();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;h=he-hs;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;ws=0;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;we=getmaxy();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;w=we-ws;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;void putpoint(int op, float x, float y)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;df_x[fre]=x;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;df_y[fre]=y;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;if(df_x[fre]==0 || df_y[fre]==0)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; df_x[fre]=x;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;&amp;nbsp; &amp;nbsp; df_y[fre]=y;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;df_op[fre]=op;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;fre++;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;void display_file(int op)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;putpoint(op, df_penx, df_peny);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;void line_rel(float x, float y)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;df_penx+=x;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;df_peny+=y;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;display_file(2);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;void line_abs(float dx, float dy)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;df_penx=dx;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;df_peny=dy;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;display_file(2);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;void move_abs(float a_x[], float a_y[], int j)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;float tempx, tempy;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;if(j&amp;lt;3)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;printf(&quot;It not ploygone...&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;else&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;df_penx+=a_x[0];&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;df_peny+=a_y[0];&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;tempx=df_penx;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;tempy=df_peny;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;display_file(j);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;for(n=1;n&amp;lt;j;n++)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;line_rel(a_x[n], a_y[n]);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;line_abs(tempx, tempy);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;float max(float a, float b)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;if(a&amp;gt;b)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;return (a);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;else&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;return (b);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;float min(float a, float b)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;if(a&amp;lt;b)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;return (a);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;else&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;return (b);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;void bresenham(int xa, int ya, int xb, int yb);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;void domove(float x, float y)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;float p1, q1;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;p1=min(we, (x*w+ws));&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;q1=min(he, (y*h+hs));&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;frame_penx=max(ws, p1);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;frame_peny=max(hs, q1);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;void doline(float x, float y){&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;float p1, q1;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;p1=min(we, (x*w+ws));&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;q1=min(he, (y*h+hs));&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;x1=frame_penx;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;y1=frame_peny;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;frame_penx=max(ws, p1);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;frame_peny=max(hs, q1);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;bresenham(r(x1), r(y1), r(frame_penx), r(frame_peny));&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;void dopol(float x, float y)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;domove(x, y);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;void getpoint(int n)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;op=df_op[n];&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;x=df_x[n];&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;y=df_y[n];&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;void interpret(int s, int count)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;for(n=s;n&amp;lt;=count;n++)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;getpoint(n);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;if(op==1)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;domove(x, y);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;else if(op==2)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;doline(x, y);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;else&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;dopol(x, y);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;void make_pic()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;if(erase_flag==1)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;erase();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;erase_flag=0;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;if(fre&amp;gt;1)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;interpret(0, fre-1);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;fre=0;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;void main()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;clrscr();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;initgraph(&amp;amp;gdriver, &amp;amp;gmode, &quot;C:\\TurboC3\\BGI&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;initialize();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;new_frame();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;move_abs(a_x, a_y, 6);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;make_pic();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;getch();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;void bresenham(int xa, int ya, int xb, int yb)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;int p, x, y, dx, dy, twodydx, twody, twodxdy, twodx, xend, yend;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;float m;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;dx=abs(xa-xb);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;dy=abs(ya-yb);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;m=(float)(yb-ya)/(xb-xa);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;if(dx&amp;gt;dy)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;p=2*dy-dx;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;twody=2*dy;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;twodydx=2*(dy-dx);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;if(xa&amp;gt;xb)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;x=xb;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;y=yb;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;xend=xa;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;else&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;x=xa;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;y=ya;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;xend=xb;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;putpixel(x, y, 3);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;while(x&amp;lt;xend)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;x++;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;if(p&amp;lt;0)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;p=p+twody;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;else&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;if(0&amp;lt;m &amp;amp;&amp;amp; m&amp;lt;1)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;					&lt;/span&gt;y++;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;else&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;					&lt;/span&gt;y--;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;p=p+twodydx;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;putpixel(x, y, 3);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;else&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;p=2*dx-dy;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;twodx=2*dx;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;twodxdy=2*(dx-dy);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;if(ya&amp;gt;yb)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;x=xb;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;y=yb;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;yend=ya;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;else&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;x=xa;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;y=ya;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;yend=yb;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;putpixel(x, y, 3);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;while(y&amp;lt;yend)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;y++;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;if(p&amp;lt;0)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;p=p+twodx;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;else&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;if(m&amp;gt;=1)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;					&lt;/span&gt;x++;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;else&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;					&lt;/span&gt;x--;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;				&lt;/span&gt;p=p+twodxdy;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;			&lt;/span&gt;putpixel(x, y, 3);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;}&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2020/11/samsung-galaxy-f41-price.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;Know more about Samsung Galaxy F41&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2020/12/write-a-java-program-that-has-a-class-called-number-system-make-functions-for-tobinary-tooctal-tohexadecimal.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;Number System In Java&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Comment your views on this Article :)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;Thank you for visiting my blog :)&lt;/span&gt;&lt;/h2&gt;&lt;div&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://techfreakforu.blogspot.com/feeds/755016676407089062/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://techfreakforu.blogspot.com/2020/11/c-program-of-polygon-relative-in-computer-graphics.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/755016676407089062'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/755016676407089062'/><link rel='alternate' type='text/html' href='https://techfreakforu.blogspot.com/2020/11/c-program-of-polygon-relative-in-computer-graphics.html' title='C Program of Polygon Relative In Computer Graphics'/><author><name>Shubhank Shah</name><uri>http://www.blogger.com/profile/14127870435464846441</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmTbp8ZD9aPrsPr-snD4qfX_2SxjEvesdx4MVlpFmGFMF6U0kcCEKDPdKY3e9-TLxDjOor67Lq3IXtH-lC-IYsseQ85OQGVP_J6851CyJdTd-e79qVW4QM1XK8h09eeWo/s124/WhatsApp+Image+2020-06-15+at+1.30.36+PM.jpeg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2a2C10yde6uD2LeFv2zGTCaIZmD904_8lGfTCLT0OHCgrwmsjv-phtv5CHrhDZOASHPz775_SDj89NGIp4Ie9kPvcY9NbTPRAhiPfFH8WLA0ZXbel3WgMfbvKtIwBsFg35WWdf3HjgiDi/s72-w640-h408-c/c-program-of-polygon-relative-in-computer-graphics.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5267022146033422138.post-6446646386359929569</id><published>2020-11-29T15:26:00.002+05:30</published><updated>2021-06-30T11:23:14.253+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Samsung"/><title type='text'>Samsung Galaxy F41 - Price | Full Specification | Features</title><content type='html'>&lt;h1 style=&quot;text-align: left;&quot;&gt;&amp;nbsp;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;General Information&lt;/span&gt;&lt;/h1&gt;&lt;div&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEnXOjb5qqIMZTQuBPimSZCDVsBN0SBGqIERUMyyGQYqOzcWAnNxpqCAqkoeUz78DQJE4xFffAgPg3XWItCBpo_CZxOMMe1WCqlZzWF1sX0WzLq7O-a_yD85I8NJwPOQlZqxgW9pXYcczC/s1280/samsung-galaxy-f41-price.jpg&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;samsung galaxy f41 price,samsung galaxy f41 price in india,samsung galaxy f41 full specification,samsung galaxy f41 price delhi,samsung galaxy f41 specs,samsung galaxy f41 amazon,samsung galaxy f41 launch date in india,samsung galaxy f41 price in india flipkart&quot; border=&quot;0&quot; data-original-height=&quot;720&quot; data-original-width=&quot;1280&quot; height=&quot;360&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEnXOjb5qqIMZTQuBPimSZCDVsBN0SBGqIERUMyyGQYqOzcWAnNxpqCAqkoeUz78DQJE4xFffAgPg3XWItCBpo_CZxOMMe1WCqlZzWF1sX0WzLq7O-a_yD85I8NJwPOQlZqxgW9pXYcczC/w640-h360/samsung-galaxy-f41-price.jpg&quot; title=&quot;Samsung Galaxy F41 Price&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt;Image Source - Google | Image By -&amp;nbsp;&lt;a href=&quot;https://technosports.co.in/2020/09/24/samsung-galaxy-f41-will-arrive-on-8th-october-in-india/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;technosports&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;• Samsung Galaxy F41 was launched in India on October 8, 2020.&lt;/span&gt;&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• This smartphone runs on the Android version 10 operating system, which is powered by an octa-core processor.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Samsung Galaxy F41 has a Full HD+ AMOLED display and this model&#39;s weight is 191 gm.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Screen resolution of this smartphone is 2340*1080, which is a very good feature of this product.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• When it comes to the camera, this model has 3 rear cameras and 1 front camera.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• This model consists of 6000 mAh powerful battery backup.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• This smartphone has connectivity features like wi-fi, Bluetooth, GPS, and many more included.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Samsung Galaxy F41 is available on Flipkart in 3 color variants.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Flipkart will give you 5% cashback on EMI with an SBI credit card and also give you 5% unlimited cash back on Flipkart axis bank credit card.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Let&#39;s understand this smartphone in detail.&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Hardware&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Samsung Galaxy F41 runs on Android version 10 operating system&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• It is powered by octa-core processor&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• It&#39;s processor is made from Exynos 9 octa 9611 chipset&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• This model&#39;s weight is 191 gm&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• It&#39;s width is 75.1 mm&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• It&#39;s height is 159.2 mm&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• This smartphone&#39;s thickness is 8.9 mm&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;RAM Variants&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Samsung Galaxy F41 is available in 2 RAM Variants,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;1. 6GB RAM, 64GB Storage&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;2. 6GB RAM, 128GB Storage&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Slots&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Samsung Galaxy F41 contains a microSD slot&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• It supports expandable storage&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• It is expandable up to 512 GB&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• This model supports USB Type C&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Camera&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Samsung Galaxy F41 has 3 Rear Cameras and 1 Front Camera&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;1. 64 MP (Rear)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;2. 8MP (Rear)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;3. 5MP (Rear)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;4. 32 MP (Front)&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Camera Features&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Samsung Galaxy F41 has an image resolution of 9000*7000 pixels&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• It has a single-camera setup&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• It supports continuous shooting with HDR (High Dynamic Range Mode) feature included&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• It&#39;s the camera has digital zoom and face detection features available&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• It has settings like exposure compensation and ISO control&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Auto flash and touch to focus is available in this model&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• This model has inbuilt LED flashlight is there&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Display Features&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Samsung Galaxy F41 has Full HD+ AMOLED display with multi-touch feature&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• It&#39;s the screen is protected by corning gorilla glass&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Screen resolution is 2340*1080, which is the best feature of this model&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• This smartphone&#39;s screen size is 6.4 Inches&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• It has bezel-less display with a waterdrop notch&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Aspect ratio of its screen is 20:9&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Screen&#39;s pixel density is 403 PPI&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Connectivity Features&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Smartphone become almost 50% useless if there are not any connectivity features included&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Samsung Galaxy F41 contains Connectivity Features like,&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;1. Wi-Fi&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;2. GPS&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;3. Bluetooth&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;4. Headphone&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;5. Volte&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Battery Specification&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Samsung Galaxy F41 consists of 6000 mAh powerful battery backup&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• It&#39;s battery type is Lithium-ion&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• Battery supports quick charging with 15W power&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• It supports USB type C for charging&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;• User can&#39;t replace this battery on its own&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;SIM Specification&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;1. SIM 1&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; • LTE/3G/4G: Yes&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; • SIM Type: Nano&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; • GSM/CDMA: GSM&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;2. SIM 2&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; • LTE/3G/4G: Yes&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; • SIM Type: Nano&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&amp;nbsp; &amp;nbsp; • GSM/CDMA: GSM&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Skins Available&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Samsung Galaxy F41 is available in 3 color variants&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;1. Fusion Black&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;2. Fusion Blue&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;3. Fusion Green&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Sensors&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;1. Fingerprint Sensor&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;2. Proximity Sensor&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;3. Ambient Light Sensor&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;4. Gyroscope&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;5. Accelerometer&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;6. Compass&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;background-color: #ffe599; color: #3d85c6; font-family: verdana;&quot;&gt;Price&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;1. &lt;a href=&quot;https://www.flipkart.com/samsung-galaxy-f41-fusion-black-64-gb/p/itmde5e6cd41fc4d?pid=MOBFV5PWGEVNPWS2&amp;amp;affid=HotDeals20&amp;amp;affExtParam2=redpixel&amp;amp;affExtParam1=36397156&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Samsung Galaxy F41 (6GB RAM, 64GB Storage)&lt;/a&gt; - Fusion Black: INR 15,499&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;2. &lt;a href=&quot;https://www.flipkart.com/samsung-galaxy-f41-fusion-blue-64-gb/p/itmcdc5e93b44d55?pid=MOBFV5PWHRYTYYJF&amp;amp;affid=HotDeals20&amp;amp;affExtParam2=redpixel&amp;amp;affExtParam1=36397232&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Samsung Galaxy F41 (6GB RAM, 64GB Storage)&lt;/a&gt; - Fusion Blue: INR 15,499&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;3. &lt;a href=&quot;https://www.flipkart.com/samsung-galaxy-f41-fusion-green-64-gb/p/itmce548f0500d55?pid=MOBFV5PWXJRV9WZZ&amp;amp;affid=HotDeals20&amp;amp;affExtParam2=redpixel&amp;amp;affExtParam1=36397273&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Samsung Galaxy F41 (6GB RAM, 64GB Storage)&lt;/a&gt; - Fusion Green: INR 15,499&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;4. &lt;a href=&quot;https://www.flipkart.com/samsung-galaxy-f41-fusion-black-128-gb/p/itme88b8042fe996?pid=MOBFV5PWUHRY2MZZ&amp;amp;affid=HotDeals20&amp;amp;affExtParam2=redpixel&amp;amp;affExtParam1=36397325&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Samsung Galaxy F41 (6GB RAM, 128GB Storage)&lt;/a&gt; - Fusion Black: INR 16,499&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;5. &lt;a href=&quot;https://www.flipkart.com/samsung-galaxy-f41-fusion-green-128-gb/p/itma41850a2f9e19?pid=MOBFV5PWEX7WJS7R&amp;amp;affid=HotDeals20&amp;amp;affExtParam2=redpixel&amp;amp;affExtParam1=36397371&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Samsung Galaxy F41 (6GB RAM, 128GB Storage)&lt;/a&gt; - Fusion Green: INR 16,499&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2020/11/write-a-java-program-that-will-do-sum-of-numbers-find-average-find-any-number-sort-all-numbers.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;Number operations in java&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;a href=&quot;https://techfreakforu.blogspot.com/2020/11/c-program-of-polygon-relative-in-computer-graphics.html&quot; style=&quot;background-color: #cfe2f3;&quot; target=&quot;_blank&quot;&gt;Polygon Relative in Computer Graphics&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;Comment your views on this Article :)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: helvetica; font-size: x-large;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;Thank you for visiting my blog :)&lt;/span&gt;&lt;/h2&gt;&lt;div&gt;&lt;span style=&quot;font-family: &amp;quot;helvetica&amp;quot;; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://techfreakforu.blogspot.com/feeds/6446646386359929569/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://techfreakforu.blogspot.com/2020/11/samsung-galaxy-f41-price.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/6446646386359929569'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5267022146033422138/posts/default/6446646386359929569'/><link rel='alternate' type='text/html' href='https://techfreakforu.blogspot.com/2020/11/samsung-galaxy-f41-price.html' title='Samsung Galaxy F41 - Price | Full Specification | Features'/><author><name>Shubhank Shah</name><uri>http://www.blogger.com/profile/14127870435464846441</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmTbp8ZD9aPrsPr-snD4qfX_2SxjEvesdx4MVlpFmGFMF6U0kcCEKDPdKY3e9-TLxDjOor67Lq3IXtH-lC-IYsseQ85OQGVP_J6851CyJdTd-e79qVW4QM1XK8h09eeWo/s124/WhatsApp+Image+2020-06-15+at+1.30.36+PM.jpeg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEnXOjb5qqIMZTQuBPimSZCDVsBN0SBGqIERUMyyGQYqOzcWAnNxpqCAqkoeUz78DQJE4xFffAgPg3XWItCBpo_CZxOMMe1WCqlZzWF1sX0WzLq7O-a_yD85I8NJwPOQlZqxgW9pXYcczC/s72-w640-h360-c/samsung-galaxy-f41-price.jpg" height="72" width="72"/><thr:total>0</thr:total></entry></feed>