<?xml version="1.0" encoding="UTF-8" standalone="no"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:gd="http://schemas.google.com/g/2005" xmlns:georss="http://www.georss.org/georss" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-7867323827570382405</atom:id><lastBuildDate>Thu, 19 Dec 2024 03:22:17 +0000</lastBuildDate><category>C language</category><category>array</category><category>c program</category><category>program</category><category>java</category><category>Area</category><category>Frame construction</category><category>Pointers</category><category>Recurrsion</category><category>searching</category><category>1</category><category>Applet</category><category>Beginner</category><category>Binary</category><category>Binary search</category><category>Circle</category><category>Circumference</category><category>Constructor</category><category>Decimal</category><category>Diameter</category><category>Even</category><category>Factorial</category><category>Find</category><category>First c program part 1</category><category>Hackerrank</category><category>Java Swing</category><category>Linear search</category><category>Overview</category><category>Perimeter</category><category>Power</category><category>Problem</category><category>Python</category><category>Swapping</category><category>Triangle</category><category>Ucer</category><category>ascending order</category><category>awt</category><category>c</category><category>call by reference</category><category>conversion</category><category>core java</category><category>datatype</category><category>difference</category><category>graphics</category><category>odd</category><title>Geeky Programmer</title><description></description><link>https://tweetprogrammer.blogspot.com/</link><managingEditor>noreply@blogger.com (Mohammad Saquib Khan)</managingEditor><generator>Blogger</generator><openSearch:totalResults>22</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><language>en-us</language><itunes:explicit>no</itunes:explicit><itunes:subtitle/><itunes:owner><itunes:email>noreply@blogger.com</itunes:email></itunes:owner><xhtml:meta content="noindex" name="robots" xmlns:xhtml="http://www.w3.org/1999/xhtml"/><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7867323827570382405.post-5907695720803612083</guid><pubDate>Sun, 01 Sep 2019 11:33:00 +0000</pubDate><atom:updated>2019-11-14T23:11:50.933-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Hackerrank</category><category domain="http://www.blogger.com/atom/ns#">Problem</category><category domain="http://www.blogger.com/atom/ns#">Python</category><category domain="http://www.blogger.com/atom/ns#">Ucer</category><title>Hacker-Rank Problem Solution (UCER-PYTHON)</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;h3 style="text-align: left;"&gt;
&lt;span style="background-color: #f3f3f3;"&gt;
&amp;nbsp;&lt;span style="font-family: &amp;quot;verdana&amp;quot; , sans-serif;"&gt;HACKER - RANK PROBLEM SOLUTION&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;UCER _PYTHON&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;h3 style="text-align: left;"&gt;
&lt;span style="font-family: &amp;quot;verdana&amp;quot; , sans-serif;"&gt;&lt;span style="background-color: #f3f3f3; font-family: &amp;quot;verdana&amp;quot; , sans-serif;"&gt;{Coded by: Mohammad Saquib khan}&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;h3 style="text-align: left;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUV6yqiJKlzBIyv12I5b_L8exePBdP17cgv30e1lyyfl-9OsSuJzB-2y-sH-6rvQlC1TGz_Yy3VuHJhEjjsatSD6frpML2SVz8qzPNIhHLSjEeJMuvBnvvGczRaiQ8mz-QTgXNatjcquSd/s1600/Logo-1567369006562.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em; text-align: center;"&gt;&lt;img border="0" data-original-height="1000" data-original-width="1000" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUV6yqiJKlzBIyv12I5b_L8exePBdP17cgv30e1lyyfl-9OsSuJzB-2y-sH-6rvQlC1TGz_Yy3VuHJhEjjsatSD6frpML2SVz8qzPNIhHLSjEeJMuvBnvvGczRaiQ8mz-QTgXNatjcquSd/s200/Logo-1567369006562.png" width="200" /&gt;&lt;/a&gt;&lt;span style="font-family: &amp;quot;verdana&amp;quot; , sans-serif;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: &amp;quot;verdana&amp;quot; , sans-serif;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/h3&gt;
&lt;div&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;1. Find the number of Vowels,Consonants,Digits&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;i&gt;&lt;b&gt;&lt;u&gt;Source Code:&lt;/u&gt;&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;str=input()&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;def countCharacterType(str):&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; vowels = 0&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; consonant = 0&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; specialChar = 0&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; digit = 0&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; for i in range(0, len(str)):&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ch = str[i]&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if ( (ch &amp;gt;= 'a' and ch &amp;lt;= 'z') or&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(ch &amp;gt;= 'A' and ch &amp;lt;= 'Z') ):&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ch = ch.lower()&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (ch == 'a' or ch == 'e' or ch == 'i'&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; or ch == 'o' or ch == 'u'):&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; vowels += 1&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else:&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; consonant += 1&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; elif (ch &amp;gt;= '0' and ch &amp;lt;= '9'):&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; digit +=1&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; print(vowels)&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; print(consonant)&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; print(digit)&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;countCharacterType(str)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;2.Pyramid Star pattern 1&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;u&gt;&lt;i&gt;&lt;b&gt;Source Code:&lt;/b&gt;&lt;/i&gt;&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;def full_pyramid(rows):&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; for i in range(rows):&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(' '*(rows-i-1) + '*'*(2*i+1))&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;n=int(input())&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;full_pyramid(n)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;b style="font-size: x-large;"&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style="font-size: x-large;"&gt;3. Mirrored Right triangle star pattern&lt;/b&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;&lt;u&gt;&lt;i&gt;Source code:&lt;/i&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;k=0&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;j=0&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;n=int(input())&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;for i in range(1,n+1):&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; for j in range(0,n-i):&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print("",end=" ")&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; for k in range(1,i+1):&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print("*",end="")&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; print()&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;4. Right triangle star pattern&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;&lt;i&gt;&lt;u&gt;Source code:&lt;/u&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;def pypattern(n):&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; for i in range(0, n):&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for j in range(0, i+1):&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print("*",end="")&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print("\r")&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;n = int(input())&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;pypattern(n)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;5.Factorial using Recurrsion&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;&lt;u&gt;&lt;i&gt;Source code:&lt;/i&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;def factorial(n):&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; return 1 if (n==1 or n==0) else n * factorial(n - 1);&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;num = int(input())&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;print(factorial(num))&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;6.Print Table&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b&gt;&lt;u&gt;&lt;i&gt;&lt;span style="font-size: large;"&gt;Source code:&lt;/span&gt;&lt;/i&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;n=int(input())&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;for i in range(1,11):&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; j=i*n&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; print(n,"*",i,"=",j)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;7.Find the Maximum:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;&lt;u&gt;&lt;i&gt;Source code:&lt;/i&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;a=int(input())&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;b=int(input())&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;c=int(input())&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;if(a&amp;gt;b and a&amp;gt;c):&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; print(a)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;elif(b&amp;gt;a and b&amp;gt;c):&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; print(b)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;else:&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; print(c)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;8.Find the Factorial using Function&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;&lt;u&gt;&lt;i&gt;Source code:&lt;/i&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;a=int(input())&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;f=1&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;for i in range(1,a+1):&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; f=f*i&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;print(f)&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;9.Arithmetic Operators&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;b style="font-size: x-large;"&gt;&lt;i&gt;&lt;u&gt;Source code:&lt;/u&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;if __name__ == '__main__':&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; a = int(input())&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; b = int(input())&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; print(a+b)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; print(a-b)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; print(a*b)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;10. Python:Division&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style="font-size: x-large;"&gt;&lt;u&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/u&gt;&lt;/b&gt;
&lt;b style="font-size: x-large;"&gt;&lt;u&gt;&lt;i&gt;Source code:&lt;/i&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;if __name__ == '__main__':&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; a = int(input())&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; b = int(input())&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; c = a/b&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; d = int(c)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; print(d)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; print(c)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;11.Find Digits&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;&lt;u&gt;&lt;i&gt;Source Code:&lt;/i&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;def finddigits(inputarray):&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; for element in inputarray:&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; counter = 0&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; orig = element&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; while int(element):&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; digit = int(element) % 10&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (int(digit) != 0.0 and (orig % digit == 0.0)):&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; counter = counter + 1&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; element = int(element)/10&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print (counter)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;testcase = int(input())&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;inputarray = []&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;for x in range(0, testcase):&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; inputele = int(input())&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; inputarray.append(inputele)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;finddigits(inputarray)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;12. List Comprehensions&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;&lt;u&gt;&lt;i&gt;Source Code:&lt;/i&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;xlist = range(int(input()) + 1)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;ylist = range(int(input()) + 1)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;zlist = range(int(input()) + 1)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;n = int(input())&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;lst = [[x,y,z] for x in xlist for y in ylist for z in zlist if x + y + z != n]&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;print(lst)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;13. The Captain's Room&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;&lt;u&gt;&lt;i&gt;Source Code:&lt;/i&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;k, arr = int(input()), list(map(int, input().split()))&lt;br /&gt;&lt;br /&gt;myset = set(arr)&lt;br /&gt;print(((sum(myset)*k)-(sum(arr)))//(k-1))&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;14. Nested Lists&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;&lt;u&gt;&lt;i&gt;Source Code:&lt;/i&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;def secondlow(students):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; grades = []&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for student in students: &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; grades.append(student[1])&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sort_grades = sorted(grades)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; seclow_grade = sort_grades[0]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for grade in sort_grades:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if grade != seclow_grade:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; seclow_grade = grade&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; seclow_stud = []&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for student in students: &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if student[1] == seclow_grade:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; seclow_stud.append(student[0])&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for name in sorted(seclow_stud): &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print(name)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;students = []&lt;br /&gt;for pupil in range(int(input())):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; new_stud = [input(), float(input())]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; students.append(new_stud)&lt;br /&gt;secondlow(students)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;15. sWAP cASE&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;&lt;u&gt;&lt;i&gt;Source Code:&lt;/i&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;def swap_case(s):&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; return s.swapcase()&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;if __name__ == '__main__':&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; s = input()&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; result = swap_case(s)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; print(result)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;16. Finding the Percentage&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;&lt;u&gt;&lt;i&gt;Source Code:&lt;/i&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;N = int(input())&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;dictionary = {}&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;for i in range(0, N):&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; inputArray = input().split()&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; marks = list(map(float, inputArray[1:]))&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; dictionary[inputArray[0]] = sum(marks)/float(len(marks))&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;print("%.2f" % dictionary[input()])&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;17. String Validators&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;&lt;i&gt;&lt;u&gt;Source Code:&lt;/u&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;if __name__ == '__main__':&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; s = input()&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;print (any(c.isalnum() for c in s))&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;print (any(c.isalpha() for c in s))&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;print (any(c.isdigit() for c in s))&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;print (any(c.islower() for c in s))&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;print (any(c.isupper() for c in s))&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;18. Designer Door Mat&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: medium;"&gt;&lt;b&gt;&lt;span style="font-size: x-small;"&gt;(Compile the program in Python 2)&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;&lt;i&gt;&lt;u&gt;Source Code:&lt;/u&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif; font-size: large;"&gt;N,M = map(int,raw_input().split())&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style="font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif; font-size: large;"&gt;for i in xrange(1, N, 2):&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif; font-size: large;"&gt;&amp;nbsp; &amp;nbsp; print ( str('.|.')*i ).center(M, '-')&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif; font-size: large;"&gt;print str('WELCOME').center(M, '-')&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif; font-size: large;"&gt;for i in xrange(N-2, -1, -2):&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif; font-size: large;"&gt;&amp;nbsp; &amp;nbsp; print ( str('.|.')*i ).center(M, '-')&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="font-size: large;"&gt;19. Find the Runner-Up-Score&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;u&gt;&lt;span style="font-size: large;"&gt;Source Code:&lt;/span&gt;&lt;/u&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;georgia&amp;quot; , &amp;quot;times new roman&amp;quot; , serif; font-size: large;"&gt;n = int(input())&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;georgia&amp;quot; , &amp;quot;times new roman&amp;quot; , serif; font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-family: &amp;quot;georgia&amp;quot; , &amp;quot;times new roman&amp;quot; , serif; font-size: large;"&gt;nums = map(int, input().split())&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;georgia&amp;quot; , &amp;quot;times new roman&amp;quot; , serif; font-size: large;"&gt;print(sorted(list(set(nums)))[-2])&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="font-size: large;"&gt;20. Map and Lambda Function&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;u&gt;&lt;span style="font-size: large;"&gt;Source Code:&lt;/span&gt;&lt;/u&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;cube = lambda x: x**3 # complete the lambda function&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;def fibonacci(n):&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; # return a list of fibonacci numbers&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; initiallist = []&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; for i in range(n):&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if i &amp;lt; 2:&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; initiallist += [i]&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else:&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; initiallist += [initiallist[-1] + initiallist[-2]]&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&amp;nbsp; &amp;nbsp; return initiallist&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;verdana&amp;quot; , sans-serif;"&gt;&lt;span style="font-size: medium;"&gt;&lt;b&gt;21. Alphabet Rangoli&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;u&gt;&lt;i&gt;&lt;b&gt;Source Code:&amp;nbsp;&lt;/b&gt;&lt;/i&gt;&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;def print_rangoli(size):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; width&amp;nbsp; = size*4-3&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; string = ''&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for i in range(1,size+1):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for j in range(0,i):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string += chr(96+size-j)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if len(string) &amp;lt; width :&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string += '-'&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for k in range(i-1,0,-1):&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string += chr(97+size-k)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if len(string) &amp;lt; width :&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string += '-'&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print(string.center(width,'-'))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string = ''&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for i in range(size-1,0,-1):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string = ''&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for j in range(0,i):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string += chr(96+size-j)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if len(string) &amp;lt; width :&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string += '-'&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for k in range(i-1,0,-1):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string += chr(97+size-k)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if len(string) &amp;lt; width :&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string += '-'&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print(string.center(width,'-'))&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&lt;span style="font-size: large;"&gt;&lt;b&gt;&lt;span style="font-size: medium;"&gt;20: Introduction to sets:&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;i&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;Source Code:&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;/u&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;def average(array):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return sum(set(array))/len(set(array))&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style="font-size: large;"&gt;21: Set.add()&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;i&gt;&lt;u&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;Source code:&lt;/span&gt;&lt;/b&gt;&lt;/u&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;#!/usr/bin/env python&lt;br /&gt;&lt;br /&gt;N = int(raw_input())&lt;br /&gt;&lt;br /&gt;countries = set()&lt;br /&gt;&lt;br /&gt;for i in range(N):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; countries.add(raw_input())&lt;br /&gt;&lt;br /&gt;print len(countries)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;22: No Idea!&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;i&gt;&lt;u&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;Source Code:&lt;/span&gt;&lt;/b&gt;&lt;/u&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;n, m = (int(i) for i in input().split())&lt;br /&gt;l = map(int, input().strip().split(' '))&lt;br /&gt;a = set(map(int, input().strip().split(' ')))&lt;br /&gt;b = set(map(int, input().strip().split(' ')))&lt;br /&gt;result = 0&lt;br /&gt;for i in l:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if i in a:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result += 1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if i in b:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result += -1&lt;br /&gt;print(result)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;23: Triangle Number&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;u&gt;&lt;span style="font-size: large;"&gt;Source Code:&lt;/span&gt;&lt;/u&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;#!/bin/python3&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;import os&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;import sys&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;# Complete the solve function below.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;def solve(n):&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if n%2!=0:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 2&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; n-=4&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; n//=2&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if n%2==0:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 3&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 4&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;if __name__ == '__main__':&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fptr = open(os.environ['OUTPUT_PATH']&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir="ltr"&gt;
&lt;wbr&gt;&lt;/wbr&gt;&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;, 'w')&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; t = int(input())&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for t_itr in range(t):&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; n = int(input())&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = solve(n)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fptr.write(str(result) + '\n')&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fptrclose()&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;2&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;4&lt;/span&gt;: &lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;Find the Tors&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;i&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;onal A&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;ngl&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;e&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&lt;u&gt;&lt;i&gt;Source Code:&lt;/i&gt;&lt;/u&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;class Points(object):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; def __init__(self, x, y, z):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.x = x&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.y = y&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.z = z&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; def __sub__(self, no):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x = self.x - no.x&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y = self.y - no.y&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; z = self.z - no.z&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return Points(x, y, z)&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; def dot(self, no):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x = self.x * no.x&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y = self.y * no.y&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; z = self.z * no.z&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return x + y + z&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; def cross(self, no):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x = self.y * no.z - self.z * no.y&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y = self.z * no.x - self.x * no.z&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; z = self.x * no.y - self.y * no.x&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return Points(x, y, z)&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; def absolute(self):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return pow((self.x ** 2 + self.y ** 2 + self.z ** 2), 0.5)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&amp;nbsp;&lt;b&gt;25: Triangle Quest&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&lt;b&gt;&lt;u&gt;&lt;i&gt;S&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;ource Code:&lt;/span&gt;&lt;/i&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;for i in range(1, input()):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print ((10 ** i - 1) / 9) * i&amp;nbsp;&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&lt;b&gt;26: Dealing with Complex Numbers&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&lt;b&gt;&lt;u&gt;&lt;i&gt;Source Code:&lt;/i&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;&lt;span style="font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;"&gt;class Complex(object):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; def __init__(self, real, imaginary):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.real = real&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.imaginary = imaginary&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; def __add__(self, no):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real = self.real + no.real&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; imaginary = self.imaginary + no.imaginary&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return Complex(real, imaginary)&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; def __sub__(self, no):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real = self.real - no.real&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; imaginary = self.imaginary - no.imaginary&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return Complex(real, imaginary)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; def __mul__(self, no):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real = self.real * no.real - self.imaginary * no.imaginary&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; imaginary = self.real * no.imaginary + self.imaginary * no.real&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return Complex(real, imaginary)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; def __div__(self, no):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x = float(no.real ** 2 + no.imaginary ** 2)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y = self * Complex(no.real, -no.imaginary)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real = y.real / x&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; imaginary = y.imaginary / x&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return Complex(real, imaginary)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; def mod(self):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real = math.sqrt(self.real ** 2 + self.imaginary ** 2)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return Complex(real, 0)&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; def __str__(self):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if self.imaginary == 0:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = "%.2f+0.00i" % (self.real)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; elif self.real == 0:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if self.imaginary &amp;gt;= 0:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = "0.00+%.2fi" % (self.imaginary)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = "0.00-%.2fi" % (abs(self.imaginary))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; elif self.imaginary &amp;gt; 0:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = "%.2f+%.2fi" % (self.real, self.imaginary)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = "%.2f-%.2fi" % (self.real, abs(self.imaginary))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return result&lt;b&gt;&lt;u&gt;&lt;i&gt;&amp;nbsp;&lt;/i&gt;&lt;/u&gt; &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</description><link>https://tweetprogrammer.blogspot.com/2019/09/blog-post.html</link><author>noreply@blogger.com (Mohammad Saquib Khan)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUV6yqiJKlzBIyv12I5b_L8exePBdP17cgv30e1lyyfl-9OsSuJzB-2y-sH-6rvQlC1TGz_Yy3VuHJhEjjsatSD6frpML2SVz8qzPNIhHLSjEeJMuvBnvvGczRaiQ8mz-QTgXNatjcquSd/s72-c/Logo-1567369006562.png" width="72"/><thr:total>2</thr:total><georss:featurename>UPSIDC Industrial Area, Naini, Prayagraj, Uttar Pradesh 211009, India</georss:featurename><georss:point>25.3431443 81.910167099999967</georss:point><georss:box>-3.0675927000000023 40.601573099999968 53.7538813 123.21876109999997</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7867323827570382405.post-7638940797777669549</guid><pubDate>Tue, 18 Jun 2019 08:39:00 +0000</pubDate><atom:updated>2019-06-18T01:39:23.797-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">1</category><category domain="http://www.blogger.com/atom/ns#">C language</category><category domain="http://www.blogger.com/atom/ns#">c program</category><category domain="http://www.blogger.com/atom/ns#">First c program part 1</category><title>Make your First C Program- 1</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;h2 style="background-color: white; font-size: 31.5px; line-height: 40px; margin: 5px 0px; text-align: left;"&gt;
&lt;span style="font-family: Georgia, Times New Roman, serif;"&gt;
First C Program and its Structure&lt;/span&gt;&lt;/h2&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhscLM2NVLJBOnp5d70JVmOMmUVCbgCSC4W4T3mfMMWdzfx-K9ZjaVirgAGmoQU8PQn8AatKgtUPxIyN5Rzz7QksS3NB4SivGad0baPeQFfT4zdp9HsXaeubQe1Ny6Ur2cxKiMR3phqttMY/s1600/Logo-1560846958861.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;img border="0" data-original-height="1600" data-original-width="1600" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhscLM2NVLJBOnp5d70JVmOMmUVCbgCSC4W4T3mfMMWdzfx-K9ZjaVirgAGmoQU8PQn8AatKgtUPxIyN5Rzz7QksS3NB4SivGad0baPeQFfT4zdp9HsXaeubQe1Ny6Ur2cxKiMR3phqttMY/s200/Logo-1560846958861.png" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="background-color: white; font-family: roboto, sans-serif; line-height: 40px; margin: 5px 0px; text-align: left;"&gt;
Lets see how to write a simple and most basic C program:&lt;/div&gt;
&lt;pre class="c language-clike" style="background: rgb(30, 42, 55); border-radius: 0.3em; color: #f8f8f2; font-family: Consolas, Monaco, &amp;quot;andale mono&amp;quot;, &amp;quot;ubuntu mono&amp;quot;, monospace; font-size: 11px; hyphens: none; line-height: 1.5; margin-bottom: 0.5em; margin-top: 0.5em; overflow-wrap: normal; overflow: auto; padding: 1em; tab-size: 4; text-shadow: rgba(0, 0, 0, 0.3) 0px 1px; word-break: normal;"&gt;&lt;code class=" language-clike" style="background: 0px 0px; border-radius: 0px; font-family: Consolas, Monaco, &amp;quot;andale mono&amp;quot;, &amp;quot;ubuntu mono&amp;quot;, monospace; font-size: inherit; hyphens: none; line-height: 1.5; overflow-wrap: normal; padding: 0px; tab-size: 4; text-shadow: rgba(0, 0, 0, 0.3) 0px 1px; word-break: normal; word-spacing: normal;"&gt;#include &lt;span class="token operator"&gt;&amp;lt;&lt;/span&gt;stdio&lt;span class="token punctuation"&gt;.&lt;/span&gt;h&lt;span class="token operator"&gt;&amp;gt;&lt;/span&gt;
int &lt;span class="token function" style="color: #e6db74;"&gt;main&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;
&lt;span class="token punctuation"&gt;{&lt;/span&gt;
 &lt;span class="token function" style="color: #e6db74;"&gt;printf&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string" style="color: #a6e22e;"&gt;"Hello,World"&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;  &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//single line comment&lt;/span&gt;
 &lt;span class="token keyword" style="color: #66d9ef;"&gt;return&lt;/span&gt; &lt;span class="token number" style="color: #ae81ff;"&gt;0&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
&lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;/*
    multi
    line
    comments
/*
}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div class="output" style="background-color: #f9f9f9; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; font-size: 12px; margin-bottom: 10px; overflow-x: scroll; padding: 10px; white-space: pre;"&gt;
Hello,World
&lt;/div&gt;
&lt;hr style="background-color: white; border-bottom-color: rgb(255, 255, 255); border-bottom-style: solid; border-image: initial; border-left: 0px; border-right: 0px; border-top-color: rgb(238, 238, 238); border-top-style: solid; font-family: Arial, sans-serif; font-size: 15px; margin: 20px 0px 20px -20px;" /&gt;
&lt;h3 style="background-color: white; font-family: roboto, sans-serif; font-size: 24.5px; line-height: 40px; margin: 5px 0px; text-rendering: optimizelegibility;"&gt;
Different parts of C program&lt;/h3&gt;
&lt;ul class="content" style="background-color: white; font-family: Arial, sans-serif; font-size: 15px; margin: 0px 0px 10px 25px; padding: 0px;"&gt;
&lt;li style="line-height: 30px;"&gt;Pre-processor&lt;/li&gt;
&lt;li style="line-height: 30px;"&gt;Header file&lt;/li&gt;
&lt;li style="line-height: 30px;"&gt;Function&lt;/li&gt;
&lt;li style="line-height: 30px;"&gt;Variables&lt;/li&gt;
&lt;li style="line-height: 30px;"&gt;Statements &amp;amp; expressions&lt;/li&gt;
&lt;li style="line-height: 30px;"&gt;Comments&lt;/li&gt;
&lt;/ul&gt;
&lt;div style="background-color: white; font-family: Arial, sans-serif; margin-bottom: 10px;"&gt;
All these are essential parts of a C language program.&lt;/div&gt;
&lt;div&gt;
&lt;h4 style="background-color: white; box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px; color: #bf360c; font-family: roboto, sans-serif; font-size: 17.5px; line-height: 20px; margin: 10px 0px; padding: 5px; text-rendering: optimizelegibility; transition: all 0.2s ease-in-out 0s;"&gt;
Pre-processor&lt;/h4&gt;
&lt;div style="background-color: white; font-family: Arial, sans-serif; margin-bottom: 10px;"&gt;
&lt;code style="background-color: #f9f2f4; border-radius: 4px; color: #c7254e; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; font-size: 13.5001px; padding: 2px 4px; white-space: nowrap;"&gt;#include&lt;/code&gt;&amp;nbsp;is the first word of any C program. It is also known as a&amp;nbsp;&lt;b&gt;pre-processor&lt;/b&gt;. The task of a pre-processor is to initialize the environment of the program, i.e to link the program with the header files required.&lt;/div&gt;
&lt;div style="background-color: white; font-family: Arial, sans-serif; margin-bottom: 10px;"&gt;
So, when we say&amp;nbsp;&lt;code style="background-color: #f9f2f4; border-radius: 4px; color: #c7254e; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; font-size: 13.5001px; padding: 2px 4px; white-space: nowrap;"&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/code&gt;, it is to inform the compiler to include the&amp;nbsp;&lt;b&gt;stdio.h&lt;/b&gt;&amp;nbsp;header file to the program before executing it.&lt;/div&gt;
&lt;hr style="background-color: white; border-bottom-color: rgb(255, 255, 255); border-bottom-style: solid; border-image: initial; border-left: 0px; border-right: 0px; border-top-color: rgb(238, 238, 238); border-top-style: solid; font-family: Arial, sans-serif; font-size: 15px; margin: 20px 0px 20px -20px;" /&gt;
&lt;h4 style="background-color: white; box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px; color: #bf360c; font-family: roboto, sans-serif; font-size: 17.5px; line-height: 20px; margin: 10px 0px; padding: 5px; text-rendering: optimizelegibility; transition: all 0.2s ease-in-out 0s;"&gt;
Header file&lt;/h4&gt;
&lt;div style="background-color: white; font-family: Arial, sans-serif; margin-bottom: 10px;"&gt;
A Header file is a collection of built-in(readymade) functions, which we can directly use in our program. Header files contain definitions of the functions which can be incorporated into any C program by using pre-processor&amp;nbsp;&lt;code style="background-color: #f9f2f4; border-radius: 4px; color: #c7254e; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; font-size: 13.5001px; padding: 2px 4px; white-space: nowrap;"&gt;#include&lt;/code&gt;statement with the header file. Standard header files are provided with each compiler, and covers a range of areas like string handling, mathematical functions, data conversion, printing and reading of variables.&lt;/div&gt;
&lt;div style="background-color: white; font-family: Arial, sans-serif; margin-bottom: 10px;"&gt;
With time, you will have a clear picture of what header files are, as of now consider as a readymade piece of function which comes packaged with the C language and you can use them without worrying about how they work, all you have to do is include the header file in your program.&lt;/div&gt;
&lt;div style="background-color: white; font-family: Arial, sans-serif; margin-bottom: 10px;"&gt;
To use any of the standard functions, the appropriate header file must be included. This is done at the beginning of the C source file.&lt;/div&gt;
&lt;div style="background-color: white; font-family: Arial, sans-serif; margin-bottom: 10px;"&gt;
For example, to use the&amp;nbsp;&lt;code style="background-color: #f9f2f4; border-radius: 4px; color: #c7254e; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; font-size: 13.5001px; padding: 2px 4px; white-space: nowrap;"&gt;printf()&lt;/code&gt;&amp;nbsp;function in a program, which is used to display anything on the screen, the line&amp;nbsp;&lt;code style="background-color: #f9f2f4; border-radius: 4px; color: #c7254e; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; font-size: 13.5001px; padding: 2px 4px; white-space: nowrap;"&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/code&gt;&amp;nbsp;is required because the header file&amp;nbsp;&lt;b&gt;stdio.h&lt;/b&gt;&amp;nbsp;contains the&amp;nbsp;&lt;code style="background-color: #f9f2f4; border-radius: 4px; color: #c7254e; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; font-size: 13.5001px; padding: 2px 4px; white-space: nowrap;"&gt;printf()&lt;/code&gt;&amp;nbsp;function. All header files will have an extension&amp;nbsp;&lt;code style="background-color: #f9f2f4; border-radius: 4px; color: #c7254e; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; font-size: 13.5001px; padding: 2px 4px; white-space: nowrap;"&gt;.h&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;code style="background-color: #f9f2f4; border-radius: 4px; color: #c7254e; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; font-size: 13.5001px; padding: 2px 4px; white-space: nowrap;"&gt;&lt;/code&gt;&lt;br /&gt;
&lt;h4 style="background-color: white; box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px; color: #bf360c; font-family: roboto, sans-serif; font-size: 17.5px; line-height: 20px; margin: 10px 0px; padding: 5px; text-rendering: optimizelegibility; transition: all 0.2s ease-in-out 0s; white-space: normal;"&gt;
&lt;code style="background-color: #f9f2f4; border-radius: 4px; color: #c7254e; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; font-size: 13.5001px; padding: 2px 4px; white-space: nowrap;"&gt;
main() function&lt;/code&gt;&lt;/h4&gt;
&lt;code style="background-color: #f9f2f4; border-radius: 4px; color: #c7254e; padding: 2px 4px; white-space: nowrap;"&gt;
&lt;div style="background-color: white; color: black; font-family: arial, sans-serif; font-size: 13.5001px; margin-bottom: 10px; white-space: normal;"&gt;
&lt;code style="background-color: #f9f2f4; border-radius: 4px; color: #c7254e; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; padding: 2px 4px; white-space: nowrap;"&gt;&lt;br /&gt;&lt;/code&gt;
&lt;code style="background-color: #f9f2f4; border-radius: 4px; color: #c7254e; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; padding: 2px 4px; white-space: nowrap;"&gt;&lt;br /&gt;&lt;/code&gt;
&lt;code style="background-color: #f9f2f4; border-radius: 4px; color: #c7254e; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; padding: 2px 4px; white-space: nowrap;"&gt;&lt;br /&gt;&lt;/code&gt;
&lt;code style="background-color: #f9f2f4; border-radius: 4px; color: #c7254e; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; padding: 2px 4px; white-space: nowrap;"&gt;main()&lt;/code&gt;&amp;nbsp;function is a function that must be there in every C program. Everything inside this function in a C program will be executed. In the above example,&amp;nbsp;&lt;code style="background-color: #f9f2f4; border-radius: 4px; color: #c7254e; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; padding: 2px 4px; white-space: nowrap;"&gt;int&lt;/code&gt;&amp;nbsp;written before the&amp;nbsp;&lt;code style="background-color: #f9f2f4; border-radius: 4px; color: #c7254e; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; padding: 2px 4px; white-space: nowrap;"&gt;main()&lt;/code&gt;&amp;nbsp;function is the&amp;nbsp;&lt;b&gt;return type&lt;/b&gt;&amp;nbsp;of main() function. we will discuss about it in detail later. The curly braces&amp;nbsp;&lt;code style="background-color: #f9f2f4; border-radius: 4px; color: #c7254e; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; padding: 2px 4px; white-space: nowrap;"&gt;{ }&lt;/code&gt;&amp;nbsp;just after the&amp;nbsp;&lt;b&gt;main()&lt;/b&gt;&amp;nbsp;function encloses the&amp;nbsp;&lt;b&gt;body&lt;/b&gt;&amp;nbsp;of&amp;nbsp;&lt;b&gt;main()&lt;/b&gt;&amp;nbsp;function.&lt;/div&gt;
&lt;div style="background-color: white; color: black; font-family: arial, sans-serif; font-size: 13.5001px; margin-bottom: 10px; white-space: normal;"&gt;
We will learn what functions are in upcoming tutorials.&lt;/div&gt;
&lt;hr style="background-color: white; border-bottom-color: rgb(255, 255, 255); border-bottom-style: solid; border-left: 0px; border-right: 0px; border-top-color: rgb(238, 238, 238); border-top-style: solid; color: black; font-family: arial, sans-serif; font-size: 15px; margin: 20px 0px 20px -20px; white-space: normal;" /&gt;
&lt;h4 style="background-color: white; box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px; color: #bf360c; font-family: roboto, sans-serif; font-size: 17.5px; line-height: 20px; margin: 10px 0px; padding: 5px; transition: all 0.2s ease-in-out 0s; white-space: normal;"&gt;
Comments&lt;/h4&gt;
&lt;div style="background-color: white; color: black; font-family: arial, sans-serif; font-size: 13.5001px; margin-bottom: 10px; white-space: normal;"&gt;
We can add comments in our program to describe what we are doing in the program. These comments are ignored by the compiler and are not executed.&lt;/div&gt;
&lt;div style="background-color: white; color: black; font-family: arial, sans-serif; font-size: 13.5001px; margin-bottom: 10px; white-space: normal;"&gt;
To add a single line comment, start it by adding two forward slashses&amp;nbsp;&lt;code style="background-color: #f9f2f4; border-radius: 4px; color: #c7254e; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; padding: 2px 4px; white-space: nowrap;"&gt;//&lt;/code&gt;&amp;nbsp;followed by the comment.&lt;/div&gt;
&lt;div style="background-color: white; color: black; font-family: arial, sans-serif; font-size: 13.5001px; margin-bottom: 10px; white-space: normal;"&gt;
To add multiline comment, enclode it between&amp;nbsp;&lt;code style="background-color: #f9f2f4; border-radius: 4px; color: #c7254e; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; padding: 2px 4px; white-space: nowrap;"&gt;/* .... */&lt;/code&gt;, just like in the program above.&lt;/div&gt;
&lt;hr style="background-color: white; border-bottom-color: rgb(255, 255, 255); border-bottom-style: solid; border-left: 0px; border-right: 0px; border-top-color: rgb(238, 238, 238); border-top-style: solid; color: black; font-family: arial, sans-serif; font-size: 15px; margin: 20px 0px 20px -20px; white-space: normal;" /&gt;
&lt;h4 style="background-color: white; box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px; color: #bf360c; font-family: roboto, sans-serif; font-size: 17.5px; line-height: 20px; margin: 10px 0px; padding: 5px; transition: all 0.2s ease-in-out 0s; white-space: normal;"&gt;
Return statement - return 0;&lt;/h4&gt;
&lt;div style="background-color: white; color: black; font-family: arial, sans-serif; font-size: 13.5001px; margin-bottom: 10px; white-space: normal;"&gt;
A return statement is just meant to define the end of any C program.&lt;/div&gt;
&lt;div style="background-color: white; color: black; font-family: arial, sans-serif; font-size: 13.5001px; margin-bottom: 10px; white-space: normal;"&gt;
All the C programs can be written and edited in normal text editors like Notepad or Notepad++ and must be saved with a file name with extension as&amp;nbsp;&lt;code style="background-color: #f9f2f4; border-radius: 4px; color: #c7254e; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; padding: 2px 4px; white-space: nowrap;"&gt;.c&lt;/code&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: black; font-family: arial, sans-serif; font-size: 13.5001px; margin-bottom: 10px; white-space: normal;"&gt;
If you do not add the extension&amp;nbsp;&lt;code style="background-color: #f9f2f4; border-radius: 4px; color: #c7254e; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; padding: 2px 4px; white-space: nowrap;"&gt;.c&lt;/code&gt;&amp;nbsp;then the compiler will not recognise it as a C language program file.&lt;/div&gt;
&lt;div style="font-family: monaco, menlo, consolas, &amp;quot;courier new&amp;quot;, monospace; font-size: 13.5001px;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;h2 style="background-color: white; color: black; font-family: roboto, sans-serif; font-size: 31.5px; line-height: 40px; margin: 5px 0px; text-rendering: optimizelegibility; white-space: normal;"&gt;
Compile and Run C Program&lt;/h2&gt;
&lt;h3 style="background-color: white; color: black; line-height: 40px; margin: 5px 0px; white-space: normal;"&gt;
&lt;div style="font-family: Arial, sans-serif; font-size: 24.5px; font-weight: 400; margin-bottom: 10px;"&gt;
To compile and run a C language program, you need a C compiler. To setup a C language compiler in your Computer/laptop, there are two ways:&lt;/div&gt;
&lt;ol class="content" style="font-family: Arial, sans-serif; font-size: 15px; font-weight: 400; margin: 0px 0px 10px 25px; padding: 0px;"&gt;
&lt;li style="line-height: 30px;"&gt;Download a full fledged IDE like Turbo C or Microsoft Visual C++, which comes along with a C language compiler.&lt;/li&gt;
&lt;li style="line-height: 30px;"&gt;Or, you use any text editor to edit the program files and download the C compiler separately.&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;span style="font-family: Arial, sans-serif;"&gt;&lt;span style="font-size: 15px; font-weight: 400;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/h3&gt;
&lt;h3 style="background-color: white; color: black; font-family: roboto, sans-serif; font-size: 24.5px; line-height: 40px; margin: 5px 0px; text-rendering: optimizelegibility; white-space: normal;"&gt;
Using an IDE - Turbo C&lt;/h3&gt;
&lt;h3 style="background-color: white; color: black; line-height: 40px; margin: 5px 0px; white-space: normal;"&gt;
&lt;div style="font-family: Arial, sans-serif; font-weight: 400; margin-bottom: 10px;"&gt;
We will recommend you to use&amp;nbsp;&lt;b&gt;Turbo C&lt;/b&gt;&amp;nbsp;IDE, oldest IDE for c programming. It is freely available over internet and is good for a beginner.&lt;/div&gt;
&lt;div style="font-family: Arial, sans-serif; font-weight: 400; margin-bottom: 10px;"&gt;
&lt;b&gt;Step 1 :&lt;/b&gt;&amp;nbsp;Open turbo C IDE(Integrated Development Environment), click on&amp;nbsp;&lt;b&gt;File&lt;/b&gt;&amp;nbsp;and then click on New&lt;/div&gt;
&lt;div style="font-family: Arial, sans-serif; font-size: 15px; font-weight: 400; margin-bottom: 10px;"&gt;
&lt;/div&gt;
&lt;center style="font-family: Arial, sans-serif; font-size: 15px; font-weight: 400;"&gt;
&lt;img alt="first c program with turbo C" data-cfsrc="images/first-c-program-step1.jpg" src="https://www.studytonight.com/c/images/first-c-program-step1.jpg" style="border: 0px; height: auto; max-width: 100%; vertical-align: middle;" /&gt;&lt;/center&gt;
&lt;div style="font-family: Arial, sans-serif; font-size: 15px; font-weight: 400; margin-bottom: 10px;"&gt;
&lt;/div&gt;
&lt;hr style="border-bottom-color: rgb(255, 255, 255); border-bottom-style: solid; border-image: initial; border-left: 0px; border-right: 0px; border-top-color: rgb(238, 238, 238); border-top-style: solid; font-family: Arial, sans-serif; font-size: 15px; font-weight: 400; margin: 20px 0px 20px -20px;" /&gt;
&lt;div style="font-family: Arial, sans-serif; font-weight: 400; margin-bottom: 10px;"&gt;
&lt;b&gt;Step 2 :&lt;/b&gt;&amp;nbsp;Write the above example as it is&lt;/div&gt;
&lt;div style="font-family: Arial, sans-serif; font-size: 15px; font-weight: 400; margin-bottom: 10px;"&gt;
&lt;/div&gt;
&lt;center style="font-family: Arial, sans-serif; font-size: 15px; font-weight: 400;"&gt;
&lt;img alt="Write a C program with turbo C" data-cfsrc="images/first-c-program-step2.jpg" src="https://www.studytonight.com/c/images/first-c-program-step2.jpg" style="border: 0px; height: auto; max-width: 100%; vertical-align: middle;" /&gt;&lt;/center&gt;
&lt;div style="font-family: Arial, sans-serif; font-size: 15px; font-weight: 400; margin-bottom: 10px;"&gt;
&lt;/div&gt;
&lt;hr style="border-bottom-color: rgb(255, 255, 255); border-bottom-style: solid; border-image: initial; border-left: 0px; border-right: 0px; border-top-color: rgb(238, 238, 238); border-top-style: solid; font-family: Arial, sans-serif; font-size: 15px; font-weight: 400; margin: 20px 0px 20px -20px;" /&gt;
&lt;div style="font-family: Arial, sans-serif; font-weight: 400; margin-bottom: 10px;"&gt;
&lt;b&gt;Step 3 :&lt;/b&gt;&amp;nbsp;Click on compile or press Alt+f9 to compile the code&lt;/div&gt;
&lt;div style="font-family: Arial, sans-serif; font-size: 15px; font-weight: 400; margin-bottom: 10px;"&gt;
&lt;/div&gt;
&lt;center style="font-family: Arial, sans-serif; font-size: 15px; font-weight: 400;"&gt;
&lt;img alt="Compiling a C program with turbo C" data-cfsrc="images/first-c-program-step3.jpg" src="https://www.studytonight.com/c/images/first-c-program-step3.jpg" style="border: 0px; height: auto; max-width: 100%; vertical-align: middle;" /&gt;&lt;/center&gt;
&lt;div style="font-family: Arial, sans-serif; font-size: 15px; font-weight: 400; margin-bottom: 10px;"&gt;
&lt;/div&gt;
&lt;hr style="border-bottom-color: rgb(255, 255, 255); border-bottom-style: solid; border-image: initial; border-left: 0px; border-right: 0px; border-top-color: rgb(238, 238, 238); border-top-style: solid; font-family: Arial, sans-serif; font-size: 15px; font-weight: 400; margin: 20px 0px 20px -20px;" /&gt;
&lt;div style="font-family: Arial, sans-serif; font-weight: 400; margin-bottom: 10px;"&gt;
&lt;b&gt;Step 4 :&lt;/b&gt;&amp;nbsp;Click on Run or press Ctrl+f9 to run the code&lt;/div&gt;
&lt;div style="font-family: Arial, sans-serif; font-size: 15px; font-weight: 400; margin-bottom: 10px;"&gt;
&lt;/div&gt;
&lt;center style="font-family: Arial, sans-serif; font-size: 15px; font-weight: 400;"&gt;
&lt;img alt="Running a C program with turbo C" data-cfsrc="images/first-c-program-step4.jpg" src="https://www.studytonight.com/c/images/first-c-program-step4.jpg" style="border: 0px; height: auto; max-width: 100%; vertical-align: middle;" /&gt;&lt;/center&gt;
&lt;div style="font-family: Arial, sans-serif; font-size: 15px; font-weight: 400; margin-bottom: 10px;"&gt;
&lt;/div&gt;
&lt;hr style="border-bottom-color: rgb(255, 255, 255); border-bottom-style: solid; border-image: initial; border-left: 0px; border-right: 0px; border-top-color: rgb(238, 238, 238); border-top-style: solid; font-family: Arial, sans-serif; font-size: 15px; font-weight: 400; margin: 20px 0px 20px -20px;" /&gt;
&lt;div style="font-family: Arial, sans-serif; font-weight: 400; margin-bottom: 10px;"&gt;
&lt;b&gt;Step 5 :&lt;/b&gt;&amp;nbsp;Output&lt;/div&gt;
&lt;div style="font-family: Arial, sans-serif; font-size: 15px; font-weight: 400; margin-bottom: 10px;"&gt;
&lt;/div&gt;
&lt;center style="font-family: Arial, sans-serif; font-size: 15px; font-weight: 400;"&gt;
&lt;img alt="Output of C program with turbo C" data-cfsrc="images/first-c-program-step5.jpg" src="https://www.studytonight.com/c/images/first-c-program-step5.jpg" style="border: 0px; height: auto; max-width: 100%; vertical-align: middle;" /&gt;&lt;/center&gt;
&lt;div style="font-family: Arial, sans-serif; font-size: 15px; font-weight: 400; margin-bottom: 10px;"&gt;
&lt;/div&gt;
&lt;hr style="border-bottom-color: rgb(255, 255, 255); border-bottom-style: solid; border-image: initial; border-left: 0px; border-right: 0px; border-top-color: rgb(238, 238, 238); border-top-style: solid; font-family: Arial, sans-serif; font-size: 15px; font-weight: 400; margin: 20px 0px 20px -20px;" /&gt;
&lt;/h3&gt;
&lt;h3 style="background-color: white; color: black; font-family: roboto, sans-serif; font-size: 24.5px; line-height: 40px; margin: 5px 0px; text-rendering: optimizelegibility; white-space: normal;"&gt;
Without an IDE&lt;/h3&gt;
&lt;h3 style="background-color: white; color: black; line-height: 40px; margin: 5px 0px; white-space: normal;"&gt;
&lt;div style="font-family: Arial, sans-serif; font-weight: 400; margin-bottom: 10px;"&gt;
If you do not wish to setup an IDE and prefer the old school way, then download the C compiler which is called&amp;nbsp;&lt;code style="background-color: #f9f2f4; border-radius: 4px; color: #c7254e; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; font-size: 13.5001px; padding: 2px 4px; white-space: nowrap;"&gt;gcc&lt;/code&gt;from the gcc website&amp;nbsp;&lt;a href="https://gcc.gnu.org/install/" style="color: #10a2ff; text-decoration-line: none;" target="_blank"&gt;https://gcc.gnu.org/install/&lt;/a&gt;&lt;/div&gt;
&lt;div style="font-family: Arial, sans-serif; font-weight: 400; margin-bottom: 10px;"&gt;
Once you have downloaded and installed the&amp;nbsp;&lt;code style="background-color: #f9f2f4; border-radius: 4px; color: #c7254e; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; font-size: 13.5001px; padding: 2px 4px; white-space: nowrap;"&gt;gcc&lt;/code&gt;&amp;nbsp;compiler, all you have to do it, open any text editor, copy and paste the C program code from the&amp;nbsp;&lt;a href="https://www.studytonight.com/c/compile-and-run-c-program.php" style="color: #10a2ff; text-decoration-line: none;" target="_blank"&gt;previous tutorial&lt;/a&gt;, and save it with the name&amp;nbsp;&lt;b&gt;hello.c&lt;/b&gt;&lt;/div&gt;
&lt;div style="font-family: Arial, sans-serif; font-weight: 400; margin-bottom: 10px;"&gt;
Open Command prompt or Terminal(if you use Ubunut or Mac OS), and go to the directory where you have saved the&amp;nbsp;&lt;b&gt;hello.c&lt;/b&gt;&amp;nbsp;program file.&lt;/div&gt;
&lt;div style="font-family: Arial, sans-serif; font-weight: 400; margin-bottom: 10px;"&gt;
Type the command&amp;nbsp;&lt;code style="background-color: #f9f2f4; border-radius: 4px; color: #c7254e; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; font-size: 13.5001px; padding: 2px 4px; white-space: nowrap;"&gt;gcc hello.c&lt;/code&gt;&amp;nbsp;to compile the code. This will compile the code, and if there are no errors then it will produce an output file with name&amp;nbsp;&lt;b&gt;a.out&lt;/b&gt;(default name)&lt;/div&gt;
&lt;div style="font-family: Arial, sans-serif; font-weight: 400; margin-bottom: 10px;"&gt;
Now, to run the program, type in&amp;nbsp;&lt;code style="background-color: #f9f2f4; border-radius: 4px; color: #c7254e; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; font-size: 13.5001px; padding: 2px 4px; white-space: nowrap;"&gt;./a.out&lt;/code&gt;&amp;nbsp;and you will see&amp;nbsp;&lt;b&gt;Hello, World&lt;/b&gt;&amp;nbsp;displayed on your screen.&lt;/div&gt;
&lt;pre class=" language-clike" style="background: rgb(30, 42, 55); border-radius: 0.3em; color: #f8f8f2; font-family: Consolas, Monaco, &amp;quot;andale mono&amp;quot;, &amp;quot;ubuntu mono&amp;quot;, monospace; font-size: 11px; font-weight: 400; hyphens: none; line-height: 1.5; margin-bottom: 0.5em; margin-top: 0.5em; overflow-wrap: normal; overflow: auto; padding: 1em; tab-size: 4; text-shadow: rgba(0, 0, 0, 0.3) 0px 1px; word-break: normal;"&gt;&lt;code class=" language-clike" style="background: 0px 0px; border-radius: 0px; font-family: Consolas, Monaco, &amp;quot;andale mono&amp;quot;, &amp;quot;ubuntu mono&amp;quot;, monospace; font-size: inherit; hyphens: none; line-height: 1.5; overflow-wrap: normal; padding: 0px; tab-size: 4; text-shadow: rgba(0, 0, 0, 0.3) 0px 1px; word-break: normal; word-spacing: normal;"&gt;$ gcc hello&lt;span class="token punctuation"&gt;.&lt;/span&gt;c
$ &lt;span class="token punctuation"&gt;.&lt;/span&gt;&lt;span class="token operator"&gt;/&lt;/span&gt;a&lt;span class="token punctuation"&gt;.&lt;/span&gt;out&lt;/code&gt;&lt;/pre&gt;
&lt;div class="output" style="background-color: #f9f9f9; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; font-size: 12px; font-weight: 400; margin-bottom: 10px; overflow-x: scroll; padding: 10px; white-space: pre;"&gt;
Hello,World&lt;/div&gt;
&lt;/h3&gt;
&lt;h3 style="background-color: white; color: black; font-family: roboto, sans-serif; font-size: 24.5px; line-height: 40px; margin: 5px 0px; text-rendering: optimizelegibility; white-space: normal;"&gt;
Difference between Compile and Run&lt;/h3&gt;
&lt;h3 style="background-color: white; color: black; line-height: 40px; margin: 5px 0px; white-space: normal;"&gt;
&lt;div style="font-family: Arial, sans-serif; font-weight: 400; margin-bottom: 10px;"&gt;
You must be thinking why it is a 2 step process, first we compile the code and then we run the code. So, compilation is the process where the compiler checks whether the program is correct syntax wise, and there are no errors in the syntax.&lt;/div&gt;
&lt;div style="font-family: Arial, sans-serif; font-weight: 400; margin-bottom: 10px;"&gt;
When we run a compiled program, then it actually executes the statements inside the&amp;nbsp;&lt;code style="background-color: #f9f2f4; border-radius: 4px; color: #c7254e; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; font-size: 13.5001px; padding: 2px 4px; white-space: nowrap;"&gt;main()&lt;/code&gt;&amp;nbsp;function.&lt;/div&gt;
&lt;/h3&gt;
&lt;/div&gt;
&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
</description><link>https://tweetprogrammer.blogspot.com/2019/06/make-your-first-c-program-1.html</link><author>noreply@blogger.com (Mohammad Saquib Khan)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhscLM2NVLJBOnp5d70JVmOMmUVCbgCSC4W4T3mfMMWdzfx-K9ZjaVirgAGmoQU8PQn8AatKgtUPxIyN5Rzz7QksS3NB4SivGad0baPeQFfT4zdp9HsXaeubQe1Ny6Ur2cxKiMR3phqttMY/s72-c/Logo-1560846958861.png" width="72"/><thr:total>1</thr:total><georss:featurename>UPSIDC Industrial Area, Naini, Prayagraj, Uttar Pradesh 211009, India</georss:featurename><georss:point>25.3431443 81.910167099999967</georss:point><georss:box>-2.7696452000000029 40.601573099999968 53.4559338 123.21876109999997</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7867323827570382405.post-4163001162514591032</guid><pubDate>Tue, 18 Jun 2019 07:55:00 +0000</pubDate><atom:updated>2019-06-18T00:58:34.010-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">c</category><category domain="http://www.blogger.com/atom/ns#">C language</category><category domain="http://www.blogger.com/atom/ns#">datatype</category><category domain="http://www.blogger.com/atom/ns#">Overview</category><category domain="http://www.blogger.com/atom/ns#">program</category><title>An Overview on Datatype in C programming</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;b&gt;Data type in C programming (Overview)&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2SXwS_qc_uwUlVAZMvolCa3tCapbGwol_sVt9_cMVpjKs6Iv1xc_Q8yQlbewieR3jmNU1_g4NEkNN9CssO1tchtZ4G8LaCKmmrdq4qaPTPU_deUJGLXSboMmWsNoqYxf-emp7aky9E17V/s1600/Logo-1560844441854.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;img border="0" data-original-height="1600" data-original-width="1600" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2SXwS_qc_uwUlVAZMvolCa3tCapbGwol_sVt9_cMVpjKs6Iv1xc_Q8yQlbewieR3jmNU1_g4NEkNN9CssO1tchtZ4G8LaCKmmrdq4qaPTPU_deUJGLXSboMmWsNoqYxf-emp7aky9E17V/s200/Logo-1560844441854.png" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-family: Roboto, sans-serif, Arial, Verdana, Tahoma;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-family: Roboto, sans-serif, Arial, Verdana, Tahoma;"&gt;A data-type in C programming is a set of values and is determined to act on those values. C provides various types of data-types which allow the programmer to select the appropriate type for the variable to set its value.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;The data-type in a programming language is the collection of data with values having fixed meaning as well as characteristics. Some of them are an integer, floating point, character, etc. Usually, programming languages specify the range values for given data-type.&lt;/span&gt;&lt;br /&gt;
&lt;div class="mb-2 text-center" style="box-sizing: border-box; margin-bottom: 0.5rem; text-align: center;"&gt;
&lt;div style="box-sizing: border-box; line-height: 1.7em; margin-bottom: 1rem; text-align: left;"&gt;
&lt;span style="box-sizing: border-box; font-family: Arial, Helvetica, sans-serif; text-decoration-line: underline;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="box-sizing: border-box; line-height: 1.7em; margin-bottom: 1rem; text-align: left;"&gt;
&lt;span style="box-sizing: border-box; font-family: Arial, Helvetica, sans-serif; text-decoration-line: underline;"&gt;&lt;b&gt;C Data Types are used to:&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ul style="box-sizing: border-box; font-size: 13px; margin: 0px 0px 0px 10px; padding-left: 0px; text-align: left;"&gt;
&lt;li style="box-sizing: border-box; list-style-type: none; margin-bottom: 8px; overflow: hidden; padding-bottom: 1px; padding-left: 20px; position: relative;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Identify the type of a variable when it declared.&lt;/span&gt;&lt;/li&gt;
&lt;li style="box-sizing: border-box; list-style-type: none; margin-bottom: 8px; overflow: hidden; padding-bottom: 1px; padding-left: 20px; position: relative;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Identify the type of the return value of a function.&lt;/span&gt;&lt;/li&gt;
&lt;li style="box-sizing: border-box; list-style-type: none; margin-bottom: 8px; overflow: hidden; padding-bottom: 1px; padding-left: 20px; position: relative;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Identify the type of a parameter expected by a function.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="card" style="background-clip: border-box; background-color: white; border-radius: 0.25rem; border: 1px solid rgba(0, 0, 0, 0.125); box-sizing: border-box; display: flex; flex-direction: column; font-size: 13px; min-width: 0px; overflow-wrap: break-word; position: relative; text-align: left;"&gt;
&lt;div class="card-header" style="background-color: rgba(0, 0, 0, 0.03); border-bottom: 1px solid rgba(0, 0, 0, 0.125); border-radius: calc(0.25rem - 1px) calc(0.25rem - 1px) 0px 0px; box-sizing: border-box; margin-bottom: 0px; padding: 0.75rem 1.25rem;"&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;ANSI C provides three types of data types:&lt;/span&gt;&lt;/div&gt;
&lt;div class="card-body" style="box-sizing: border-box; flex: 1 1 auto; padding: 1.25rem;"&gt;
&lt;ol style="box-sizing: border-box; margin: 0px 0px 0px 10px; padding-left: 0px;"&gt;
&lt;li style="box-sizing: border-box; counter-increment: counter 1; list-style-type: none; margin-bottom: 8px; overflow: hidden; padding-bottom: 1px; padding-left: 20px; position: relative;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="box-sizing: border-box;"&gt;Primary(Built-in) Data Types&lt;/span&gt;:&lt;br style="box-sizing: border-box;" /&gt;&lt;em style="background-color: #f9f9f9; border-radius: 2px; box-sizing: border-box; padding: 0px 4px;"&gt;void&lt;/em&gt;,&amp;nbsp;&lt;em style="background-color: #f9f9f9; border-radius: 2px; box-sizing: border-box; padding: 0px 4px;"&gt;int&lt;/em&gt;,&amp;nbsp;&lt;em style="background-color: #f9f9f9; border-radius: 2px; box-sizing: border-box; padding: 0px 4px;"&gt;char&lt;/em&gt;,&amp;nbsp;&lt;em style="background-color: #f9f9f9; border-radius: 2px; box-sizing: border-box; padding: 0px 4px;"&gt;double&lt;/em&gt;&amp;nbsp;and&amp;nbsp;&lt;em style="background-color: #f9f9f9; border-radius: 2px; box-sizing: border-box; padding: 0px 4px;"&gt;float&lt;/em&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li style="box-sizing: border-box; counter-increment: counter 1; list-style-type: none; margin-bottom: 8px; overflow: hidden; padding-bottom: 1px; padding-left: 20px; position: relative;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="box-sizing: border-box;"&gt;Derived Data Types&lt;/span&gt;:&lt;br style="box-sizing: border-box;" /&gt;&lt;em style="background-color: #f9f9f9; border-radius: 2px; box-sizing: border-box; padding: 0px 4px;"&gt;Array&lt;/em&gt;,&amp;nbsp;&lt;em style="background-color: #f9f9f9; border-radius: 2px; box-sizing: border-box; padding: 0px 4px;"&gt;References&lt;/em&gt;, and&amp;nbsp;&lt;em style="background-color: #f9f9f9; border-radius: 2px; box-sizing: border-box; padding: 0px 4px;"&gt;Pointers&lt;/em&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li style="box-sizing: border-box; counter-increment: counter 1; list-style-type: none; margin-bottom: 8px; overflow: hidden; padding-bottom: 1px; padding-left: 20px; position: relative;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="box-sizing: border-box;"&gt;User Defined Data Types&lt;/span&gt;:&lt;br style="box-sizing: border-box;" /&gt;&lt;em style="background-color: #f9f9f9; border-radius: 2px; box-sizing: border-box; padding: 0px 4px;"&gt;Structure&lt;/em&gt;,&amp;nbsp;&lt;em style="background-color: #f9f9f9; border-radius: 2px; box-sizing: border-box; padding: 0px 4px;"&gt;Union&lt;/em&gt;, and&amp;nbsp;&lt;em style="background-color: #f9f9f9; border-radius: 2px; box-sizing: border-box; padding: 0px 4px;"&gt;Enumeration&lt;/em&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3 style="box-sizing: border-box; font-size: 19px; line-height: 1.2; margin: 30px 0px 10px; text-align: left; user-select: none;"&gt;
&lt;u&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Primary Data Types:&lt;/span&gt;&lt;/u&gt;&lt;/h3&gt;
&lt;h2 style="box-sizing: border-box; font-size: 19px; font-weight: 500; line-height: 1.2; margin: 30px 0px 10px; text-align: left; user-select: none;"&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;
Every C compiler supports five primary data types:&lt;/span&gt;&lt;/h2&gt;
&lt;table class="table" style="background-color: white; border-collapse: collapse; border: 0px; box-shadow: rgba(0, 0, 0, 0.1) 0px 0px 4px 0px; box-sizing: border-box; color: #212529; font-size: 12.74px; margin: 0px 0px 1em; max-width: 100%; vertical-align: top; width: 328px;"&gt;&lt;tbody style="box-sizing: border-box;"&gt;
&lt;tr style="box-sizing: border-box;"&gt;&lt;td style="border-color: rgb(214, 214, 214) rgba(214, 214, 214, 0.5) rgba(214, 214, 214, 0.5); border-style: solid; border-width: 1px; box-sizing: border-box; color: #111111; padding: 10px; vertical-align: top;" width="125"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;void&lt;/span&gt;&lt;/td&gt;&lt;td style="border-color: rgb(214, 214, 214) rgba(214, 214, 214, 0.5) rgba(214, 214, 214, 0.5); border-style: solid; border-width: 1px; box-sizing: border-box; color: #111111; padding: 10px; vertical-align: top;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;As the name suggests, it holds no value and is generally used for specifying the type of function or what it returns. If the function has a void type, it means that the function will not return any value.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="box-sizing: border-box;"&gt;&lt;td style="border-color: rgba(214, 214, 214, 0.5); border-style: solid; border-width: 1px; box-sizing: border-box; color: #111111; padding: 10px; vertical-align: top;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;int&lt;/span&gt;&lt;/td&gt;&lt;td style="border-color: rgba(214, 214, 214, 0.5); border-style: solid; border-width: 1px; box-sizing: border-box; color: #111111; padding: 10px; vertical-align: top;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Used to denote an integer type.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="box-sizing: border-box;"&gt;&lt;td style="border-color: rgba(214, 214, 214, 0.5); border-style: solid; border-width: 1px; box-sizing: border-box; color: #111111; padding: 10px; vertical-align: top;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;char&lt;/span&gt;&lt;/td&gt;&lt;td style="border-color: rgba(214, 214, 214, 0.5); border-style: solid; border-width: 1px; box-sizing: border-box; color: #111111; padding: 10px; vertical-align: top;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Used to denote a character type.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="box-sizing: border-box;"&gt;&lt;td style="border-color: rgba(214, 214, 214, 0.5); border-style: solid; border-width: 1px; box-sizing: border-box; color: #111111; padding: 10px; vertical-align: top;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;float, double&lt;/span&gt;&lt;/td&gt;&lt;td style="border-color: rgba(214, 214, 214, 0.5); border-style: solid; border-width: 1px; box-sizing: border-box; color: #111111; padding: 10px; vertical-align: top;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Used to denote a floating point type.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="box-sizing: border-box;"&gt;&lt;td style="border-color: rgba(214, 214, 214, 0.5); border-style: solid; border-width: 1px; box-sizing: border-box; color: #111111; padding: 10px; vertical-align: top;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;int *, float *, char *&lt;/span&gt;&lt;/td&gt;&lt;td style="border-color: rgba(214, 214, 214, 0.5); border-style: solid; border-width: 1px; box-sizing: border-box; color: #111111; padding: 10px; vertical-align: top;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Used to denote a pointer type.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style="box-sizing: border-box; line-height: 1.7em; margin-bottom: 1rem; text-align: left;"&gt;
&lt;span style="box-sizing: border-box; font-family: Arial, Helvetica, sans-serif; text-decoration-line: underline;"&gt;Three more data types have been added in C99:&lt;/span&gt;&lt;/div&gt;
&lt;ul style="box-sizing: border-box; font-size: 13px; margin: 0px 0px 0px 10px; padding-left: 0px; text-align: left;"&gt;
&lt;li style="box-sizing: border-box; list-style-type: none; margin-bottom: 8px; overflow: hidden; padding-bottom: 1px; padding-left: 20px; position: relative;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;_Bool&lt;/span&gt;&lt;/li&gt;
&lt;li style="box-sizing: border-box; list-style-type: none; margin-bottom: 8px; overflow: hidden; padding-bottom: 1px; padding-left: 20px; position: relative;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;_Complex&lt;/span&gt;&lt;/li&gt;
&lt;li style="box-sizing: border-box; list-style-type: none; margin-bottom: 8px; overflow: hidden; padding-bottom: 1px; padding-left: 20px; position: relative;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;_Imaginary&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif; font-size: 13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;b&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"&gt;&lt;u&gt;Declaration of different datatypes with variable names:&lt;/u&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;div style="box-sizing: border-box; line-height: 1.7em; margin-bottom: 1rem;"&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;After taking suitable variable names, they need to be assigned with a data type. This is how the data types are used along with variables.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style="box-sizing: border-box; line-height: 1.7em; margin-bottom: 1rem;"&gt;
&lt;span style="color: #ed143d; font-family: Arial, Helvetica, sans-serif; font-size: 11.7001px;"&gt;Example:&lt;/span&gt;&lt;/div&gt;
&lt;pre style="background-color: rgba(247, 247, 247, 0.4); border-radius: 4px; border: 2px solid rgb(204, 204, 204); box-shadow: rgb(221, 221, 221) 0px 3px 0px; box-sizing: border-box; font-size: 14px; margin-bottom: 20px; max-height: 600px; overflow: auto; padding: 8px; position: relative;"&gt;&lt;code class="prettyprint prettyprinted" style="box-sizing: border-box; color: #111111; display: block; font-size: inherit; overflow-wrap: break-word; width: 308px; word-break: break-all;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;int&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;    age&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
&lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;char&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;   letter&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
&lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;float&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;  height&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;,&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; width&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div style="box-sizing: border-box; line-height: 1.7em; margin-bottom: 1rem;"&gt;
&lt;b&gt;&lt;u&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"&gt;Derived Data-Types:&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style="box-sizing: border-box; line-height: 1.7em; margin-bottom: 1rem;"&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;C supports three&amp;nbsp;derived data types:&lt;/span&gt;&lt;/div&gt;
&lt;table class="table" style="background-color: white; border-collapse: collapse; border: 0px; box-shadow: rgba(0, 0, 0, 0.1) 0px 0px 4px 0px; box-sizing: border-box; color: #212529; font-size: 12.74px; margin: 0px 0px 1em; max-width: 100%; vertical-align: top; width: 328px;"&gt;&lt;tbody style="box-sizing: border-box;"&gt;
&lt;tr style="box-sizing: border-box;"&gt;&lt;th style="background-color: #3d3d3d; border-bottom-color: rgb(51, 51, 51); border-collapse: collapse; border-left-color: rgb(51, 51, 51); border-right-color: rgb(51, 51, 51); border-style: none solid solid; border-top-color: initial; border-width: 0px 1px 1px; box-sizing: border-box; color: white; font-weight: 400; min-width: 60px; padding: 5px 10px; vertical-align: top; width: 150px;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Data Types&lt;/span&gt;&lt;/th&gt;&lt;th style="background-color: #3d3d3d; border-bottom-color: rgb(51, 51, 51); border-collapse: collapse; border-left-color: rgb(51, 51, 51); border-right-color: rgb(51, 51, 51); border-style: none solid solid; border-top-color: initial; border-width: 0px 1px 1px; box-sizing: border-box; color: white; font-weight: 400; min-width: 60px; padding: 5px 10px; vertical-align: top;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Description&lt;/span&gt;&lt;/th&gt;&lt;/tr&gt;
&lt;tr style="box-sizing: border-box;"&gt;&lt;td style="border-color: rgba(214, 214, 214, 0.5); border-style: solid; border-width: 1px; box-sizing: border-box; color: #111111; padding: 10px; vertical-align: top;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Arrays&lt;/span&gt;&lt;/td&gt;&lt;td style="border-color: rgba(214, 214, 214, 0.5); border-style: solid; border-width: 1px; box-sizing: border-box; color: #111111; padding: 10px; vertical-align: top;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Arrays are sequences of data items having homogeneous values. They have adjacent memory locations to store values.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="box-sizing: border-box;"&gt;&lt;td style="border-color: rgba(214, 214, 214, 0.5); border-style: solid; border-width: 1px; box-sizing: border-box; color: #111111; padding: 10px; vertical-align: top;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;References&lt;/span&gt;&lt;/td&gt;&lt;td style="border-color: rgba(214, 214, 214, 0.5); border-style: solid; border-width: 1px; box-sizing: border-box; color: #111111; padding: 10px; vertical-align: top;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Function pointers allow referencing functions with a particular signature.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="box-sizing: border-box;"&gt;&lt;td style="border-color: rgba(214, 214, 214, 0.5); border-style: solid; border-width: 1px; box-sizing: border-box; color: #111111; padding: 10px; vertical-align: top;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Pointers&lt;/span&gt;&lt;/td&gt;&lt;td style="border-color: rgba(214, 214, 214, 0.5); border-style: solid; border-width: 1px; box-sizing: border-box; color: #111111; padding: 10px; vertical-align: top;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;These are powerful C features which are used to access the memory and deal with their addresses.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style="box-sizing: border-box; line-height: 1.7em; margin-bottom: 1rem;"&gt;
&lt;b&gt;&lt;u&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"&gt;User-Defined Datatypes:&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style="box-sizing: border-box; line-height: 1.7em; margin-bottom: 1rem;"&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;C allows the feature called&amp;nbsp;&lt;em style="background-color: #f9f9f9; border-radius: 2px; box-sizing: border-box; padding: 0px 4px;"&gt;type definition&lt;/em&gt;&amp;nbsp;which allows programmers to define their identifier that would represent an existing data type. There are three such types:&lt;/span&gt;&lt;/div&gt;
&lt;table class="table" style="background-color: white; border-collapse: collapse; border: 0px; box-shadow: rgba(0, 0, 0, 0.1) 0px 0px 4px 0px; box-sizing: border-box; color: #212529; font-size: 12.74px; margin: 0px 0px 1em; max-width: 100%; vertical-align: top; width: 328px;"&gt;&lt;tbody style="box-sizing: border-box;"&gt;
&lt;tr style="box-sizing: border-box;"&gt;&lt;th style="background-color: #3d3d3d; border-bottom-color: rgb(51, 51, 51); border-collapse: collapse; border-left-color: rgb(51, 51, 51); border-right-color: rgb(51, 51, 51); border-style: none solid solid; border-top-color: initial; border-width: 0px 1px 1px; box-sizing: border-box; color: white; font-weight: 400; min-width: 60px; padding: 5px 10px; vertical-align: top; width: 150px;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Data Types&lt;/span&gt;&lt;/th&gt;&lt;th style="background-color: #3d3d3d; border-bottom-color: rgb(51, 51, 51); border-collapse: collapse; border-left-color: rgb(51, 51, 51); border-right-color: rgb(51, 51, 51); border-style: none solid solid; border-top-color: initial; border-width: 0px 1px 1px; box-sizing: border-box; color: white; font-weight: 400; min-width: 60px; padding: 5px 10px; vertical-align: top;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Description&lt;/span&gt;&lt;/th&gt;&lt;/tr&gt;
&lt;tr style="box-sizing: border-box;"&gt;&lt;td style="border-color: rgba(214, 214, 214, 0.5); border-style: solid; border-width: 1px; box-sizing: border-box; color: #111111; padding: 10px; vertical-align: top;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Structure&lt;/span&gt;&lt;/td&gt;&lt;td style="border-color: rgba(214, 214, 214, 0.5); border-style: solid; border-width: 1px; box-sizing: border-box; color: #111111; padding: 10px; vertical-align: top;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;It is a package of variables of different types under a single name. This is done to handle data efficiently. "struct" keyword is used to define a structure.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="box-sizing: border-box;"&gt;&lt;td style="border-color: rgba(214, 214, 214, 0.5); border-style: solid; border-width: 1px; box-sizing: border-box; color: #111111; padding: 10px; vertical-align: top;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Union&lt;/span&gt;&lt;/td&gt;&lt;td style="border-color: rgba(214, 214, 214, 0.5); border-style: solid; border-width: 1px; box-sizing: border-box; color: #111111; padding: 10px; vertical-align: top;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;These allow storing various data types in the same memory location. Programmers can define a union with different members, but only a single member can contain a value at a given time. It is used for&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="box-sizing: border-box;"&gt;&lt;td style="border-color: rgba(214, 214, 214, 0.5); border-style: solid; border-width: 1px; box-sizing: border-box; color: #111111; padding: 10px; vertical-align: top;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Enum&lt;/span&gt;&lt;/td&gt;&lt;td style="border-color: rgba(214, 214, 214, 0.5); border-style: solid; border-width: 1px; box-sizing: border-box; color: #111111; padding: 10px; vertical-align: top;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Enumeration is a special data type that consists of integral constants, and each of them is assigned with a specific name. "enum" keyword is used to define the enumerated data type.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style="box-sizing: border-box; line-height: 1.7em; margin-bottom: 1rem;"&gt;
&lt;b&gt;&lt;u&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"&gt;Datatype &amp;amp; Variable Declaration in C:&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class="preOuter" style="box-sizing: border-box; font-family: roboto, sans-serif, arial, verdana, tahoma; font-size: 13px;"&gt;
&lt;pre style="background-color: rgba(247, 247, 247, 0.4); border-radius: 4px; border: 2px solid rgb(204, 204, 204); box-shadow: rgb(221, 221, 221) 0px 3px 0px; box-sizing: border-box; color: inherit; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: 14px; margin-bottom: 20px; max-height: 600px; overflow-wrap: initial; overflow: auto; padding: 8px; position: relative; tab-size: 4; word-break: initial;"&gt;&lt;code class="prettyprint prettyprinted" style="box-sizing: border-box; color: #111111; display: block; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: inherit; overflow-wrap: break-word; tab-size: 4; width: 308px; word-break: break-all;"&gt;&lt;span class="com" style="box-sizing: border-box; color: #880000;"&gt;#include&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="str" style="box-sizing: border-box; color: #008800;"&gt;&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
&lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;int&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; main&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;()&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;{&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
    &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;int&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; a &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;=&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="lit" style="box-sizing: border-box; color: #006666;"&gt;4000&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="com" style="box-sizing: border-box; color: #880000;"&gt;// positive integer data type&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
    &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;float&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; b &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;=&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="lit" style="box-sizing: border-box; color: #006666;"&gt;5.2324&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="com" style="box-sizing: border-box; color: #880000;"&gt;// float data type&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
    &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;char&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; c &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;=&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="str" style="box-sizing: border-box; color: #008800;"&gt;'Z'&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="com" style="box-sizing: border-box; color: #880000;"&gt;// char data type&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
    &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;long&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; d &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;=&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="lit" style="box-sizing: border-box; color: #006666;"&gt;41657&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="com" style="box-sizing: border-box; color: #880000;"&gt;// long positive integer data type&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
    &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;long&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; e &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;=&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;-&lt;/span&gt;&lt;span class="lit" style="box-sizing: border-box; color: #006666;"&gt;21556&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="com" style="box-sizing: border-box; color: #880000;"&gt;// long -ve integer data type&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
    &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;int&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; f &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;=&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;-&lt;/span&gt;&lt;span class="lit" style="box-sizing: border-box; color: #006666;"&gt;185&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="com" style="box-sizing: border-box; color: #880000;"&gt;// -ve integer data type&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
    &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;short&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; g &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;=&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="lit" style="box-sizing: border-box; color: #006666;"&gt;130&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="com" style="box-sizing: border-box; color: #880000;"&gt;// short +ve integer data type&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
    &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;short&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; h &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;=&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;-&lt;/span&gt;&lt;span class="lit" style="box-sizing: border-box; color: #006666;"&gt;130&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="com" style="box-sizing: border-box; color: #880000;"&gt;// short -ve integer data type&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
    &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;double&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; i &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;=&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="lit" style="box-sizing: border-box; color: #006666;"&gt;4.1234567890&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="com" style="box-sizing: border-box; color: #880000;"&gt;// double float data type&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
    &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;float&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; j &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;=&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;-&lt;/span&gt;&lt;span class="lit" style="box-sizing: border-box; color: #006666;"&gt;3.55&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="com" style="box-sizing: border-box; color: #880000;"&gt;// float data type&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div class="tip" style="background-position: 10px 10px; background-repeat: no-repeat; border-left: 4px solid rgb(50, 205, 50); border-radius: 12px; border-right: 4px solid rgb(50, 205, 50); box-shadow: rgba(0, 0, 0, 0.1) 0px 0px 3px 1px; box-sizing: border-box; display: table; font-family: roboto, sans-serif, arial, verdana, tahoma; font-size: 13px; margin-left: 0px; padding: 10px 10px 10px 50px; width: 328px;"&gt;
The storage representation and machine instructions differ from machine to machine.&amp;nbsp;&lt;em style="background-color: #f9f9f9; border-radius: 2px; box-sizing: border-box; padding: 0px 4px;"&gt;&lt;span style="box-sizing: border-box;"&gt;sizeof&lt;/span&gt;&lt;/em&gt;&amp;nbsp;operator can use to get the exact size of a type or a variable on a particular platform.&amp;nbsp;&lt;/div&gt;
&lt;div style="box-sizing: border-box; font-family: roboto, sans-serif, arial, verdana, tahoma; line-height: 1.7em; margin-bottom: 1rem;"&gt;
&lt;span style="color: #ed143d; font-size: 11.7001px;"&gt;Example:&lt;/span&gt;&lt;/div&gt;
&lt;div class="preOuter" style="box-sizing: border-box; font-family: roboto, sans-serif, arial, verdana, tahoma; font-size: 13px;"&gt;
&lt;pre style="background-color: rgba(247, 247, 247, 0.4); border-radius: 4px; border: 2px solid rgb(204, 204, 204); box-shadow: rgb(221, 221, 221) 0px 3px 0px; box-sizing: border-box; color: inherit; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: 14px; margin-bottom: 20px; max-height: 600px; overflow-wrap: initial; overflow: auto; padding: 8px; position: relative; tab-size: 4; word-break: initial;"&gt;&lt;code class="prettyprint prettyprinted" data-file="c_sizeof_datatype" style="box-sizing: border-box; color: #111111; display: block; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: inherit; overflow-wrap: break-word; tab-size: 4; width: 308px; word-break: break-all;"&gt;&lt;span class="com" style="box-sizing: border-box; color: #880000;"&gt;#include&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="str" style="box-sizing: border-box; color: #008800;"&gt;&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
&lt;/span&gt;&lt;span class="com" style="box-sizing: border-box; color: #880000;"&gt;#include&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="str" style="box-sizing: border-box; color: #008800;"&gt;&amp;lt;limits.h&amp;gt;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
&lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;int&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; main&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;()&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;{&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
    printf&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;(&lt;/span&gt;&lt;span class="str" style="box-sizing: border-box; color: #008800;"&gt;"Storage size for int is: %d \n"&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;,&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;sizeof&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;(&lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;int&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;));&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
    printf&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;(&lt;/span&gt;&lt;span class="str" style="box-sizing: border-box; color: #008800;"&gt;"Storage size for char is: %d \n"&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;,&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;sizeof&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;(&lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;char&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;));&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
    &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;return&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="lit" style="box-sizing: border-box; color: #006666;"&gt;0&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; 
&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;code class="prettyprint prettyprinted" data-file="c_sizeof_datatype" style="box-sizing: border-box; color: #111111; display: block; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: inherit; overflow-wrap: break-word; tab-size: 4; width: 308px; word-break: break-all;"&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div class="example" style="box-sizing: border-box; color: #ed143d; font-family: roboto, sans-serif, arial, verdana, tahoma; font-size: 11.7001px;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="example" style="box-sizing: border-box; color: #ed143d; font-family: roboto, sans-serif, arial, verdana, tahoma; font-size: 11.7001px;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</description><link>https://tweetprogrammer.blogspot.com/2019/06/an-overview-on-datatype-in-c-programming.html</link><author>noreply@blogger.com (Mohammad Saquib Khan)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2SXwS_qc_uwUlVAZMvolCa3tCapbGwol_sVt9_cMVpjKs6Iv1xc_Q8yQlbewieR3jmNU1_g4NEkNN9CssO1tchtZ4G8LaCKmmrdq4qaPTPU_deUJGLXSboMmWsNoqYxf-emp7aky9E17V/s72-c/Logo-1560844441854.png" width="72"/><thr:total>0</thr:total><georss:featurename>UPSIDC Industrial Area, Naini, Prayagraj, Uttar Pradesh 211009, India</georss:featurename><georss:point>25.3431443 81.910167099999967</georss:point><georss:box>-2.7696452000000029 40.601573099999968 53.4559338 123.21876109999997</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7867323827570382405.post-3622171933966941609</guid><pubDate>Sat, 15 Jun 2019 08:22:00 +0000</pubDate><atom:updated>2019-06-15T07:26:32.672-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">core java</category><category domain="http://www.blogger.com/atom/ns#">Frame construction</category><category domain="http://www.blogger.com/atom/ns#">graphics</category><category domain="http://www.blogger.com/atom/ns#">java</category><category domain="http://www.blogger.com/atom/ns#">Java Swing</category><title>Frame Construction-2 || Java Swing || Core Graphics</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;h2 style="text-align: left;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;Frame Construction using Java Swing&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;"&gt;(CORE GRAPHICS)&lt;/span&gt;&lt;/h2&gt;
&lt;h2 style="text-align: left;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8yk-kBv_3tXgXD5uRVxR70tSySpyVADSsoUatvJYWyztrgAJ3fM1HU6eaGj0fHWME1XzRnP7Mfsw9fVLwJ8-U07H24zmrtUB0pWnJnADNlJFQQb5xk7s_4iXJ-bft2XLBccnl3RKESPju/s1600/Logo-1560585542706+%25282%2529.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em; text-align: center;"&gt;&lt;img border="0" data-original-height="1000" data-original-width="1000" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8yk-kBv_3tXgXD5uRVxR70tSySpyVADSsoUatvJYWyztrgAJ3fM1HU6eaGj0fHWME1XzRnP7Mfsw9fVLwJ8-U07H24zmrtUB0pWnJnADNlJFQQb5xk7s_4iXJ-bft2XLBccnl3RKESPju/s320/Logo-1560585542706+%25282%2529.png" width="320" /&gt;&lt;/a&gt;&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: small;"&gt;Swing Framework contains a set of classes that provides more powerful and flexible GUI components than those of&lt;/span&gt;&lt;span style="background-color: white; font-family: &amp;quot;arial&amp;quot; , sans-serif; font-size: 15px;"&gt;&amp;nbsp;&lt;/span&gt;&lt;b style="font-family: Arial, sans-serif; font-size: 15px;"&gt;AWT&lt;/b&gt;&lt;span style="background-color: white; font-family: &amp;quot;arial&amp;quot; , sans-serif; font-size: 15px;"&gt;.&lt;/span&gt;&lt;span style="background-color: white; font-family: &amp;quot;arial&amp;quot; , sans-serif; font-size: 15px;"&gt;&amp;nbsp;&lt;/span&gt;&lt;b style="font-family: Arial, sans-serif; font-size: 15px;"&gt;Swing&lt;/b&gt;&lt;span style="background-color: white; font-family: &amp;quot;arial&amp;quot; , sans-serif; font-size: 15px;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: white;"&gt;&lt;span style="font-family: &amp;quot;arial&amp;quot; , sans-serif;"&gt;&lt;span style="font-size: 15px;"&gt;provides the look and feel of modern Java GUI. Swing library is an official Java GUI tool kit released by Sun Micro-systems. It is used to create graphical user interface with Java.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;div style="background-color: white; font-family: Arial, sans-serif; font-size: 15px; margin-bottom: 10px;"&gt;
Swing classes are defined in&lt;b&gt; javax.swing &lt;/b&gt;package and its sub-packages.&lt;/div&gt;
&lt;hr style="background-color: white; border-bottom-color: rgb(255, 255, 255); border-bottom-style: solid; border-image: initial; border-left: 0px; border-right: 0px; border-top-color: rgb(238, 238, 238); border-top-style: solid; font-family: Arial, sans-serif; font-size: 15px; margin: 20px 0px 20px -20px;" /&gt;
&lt;h4 style="background-color: white; box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px; color: #bf360c; font-family: roboto, sans-serif; font-size: 17.5px; line-height: 20px; margin: 10px 0px; padding: 5px; text-rendering: optimizelegibility; transition: all 0.2s ease-in-out 0s;"&gt;
Main Features of Swing Toolkit&lt;/h4&gt;
&lt;ol class="content" style="background-color: white; font-family: Arial, sans-serif; font-size: 15px; margin: 0px 0px 10px 25px; padding: 0px;"&gt;
&lt;li style="line-height: 30px;"&gt;Platform Independent&lt;/li&gt;
&lt;li style="line-height: 30px;"&gt;Customizable&lt;/li&gt;
&lt;li style="line-height: 30px;"&gt;Extensible&lt;/li&gt;
&lt;li style="line-height: 30px;"&gt;Configurable&lt;/li&gt;
&lt;li style="line-height: 30px;"&gt;Lightweight&lt;/li&gt;
&lt;li style="line-height: 30px;"&gt;Rich Controls&lt;/li&gt;
&lt;li style="line-height: 30px;"&gt;Plug-gable Look and Feel&lt;/li&gt;
&lt;/ol&gt;
&lt;hr style="background-color: white; border-bottom-color: rgb(255, 255, 255); border-bottom-style: solid; border-image: initial; border-left: 0px; border-right: 0px; border-top-color: rgb(238, 238, 238); border-top-style: solid; font-family: Arial, sans-serif; font-size: 15px; margin: 20px 0px 20px -20px;" /&gt;
&lt;h4 style="background-color: white; box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px; color: #bf360c; font-family: roboto, sans-serif; font-size: 17.5px; line-height: 20px; margin: 10px 0px; padding: 5px; text-rendering: optimizelegibility; transition: all 0.2s ease-in-out 0s;"&gt;
Swing and JFC&lt;/h4&gt;
&lt;div style="background-color: white; font-family: Arial, sans-serif; font-size: 15px; margin-bottom: 10px;"&gt;
JFC is an abbreviation for Java Foundation classes, which encompass a group of features for building Graphical User Interfaces(GUI) and adding rich graphical functionalities and interactivity to Java applications. Java Swing is a part of Java Foundation Classes (JFC).&lt;/div&gt;
&lt;hr style="background-color: white; border-bottom-color: rgb(255, 255, 255); border-bottom-style: solid; border-image: initial; border-left: 0px; border-right: 0px; border-top-color: rgb(238, 238, 238); border-top-style: solid; font-family: Arial, sans-serif; font-size: 15px; margin: 20px 0px 20px -20px;" /&gt;
&lt;h4 style="background-color: white; box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px; color: #bf360c; font-family: roboto, sans-serif; font-size: 17.5px; line-height: 20px; margin: 10px 0px; padding: 5px; text-rendering: optimizelegibility; transition: all 0.2s ease-in-out 0s;"&gt;
Features of JFC&lt;/h4&gt;
&lt;ul class="content" style="background-color: white; font-family: Arial, sans-serif; font-size: 15px; margin: 0px 0px 10px 25px; padding: 0px;"&gt;
&lt;li style="line-height: 30px;"&gt;Swing GUI components.&lt;/li&gt;
&lt;li style="line-height: 30px;"&gt;Look and Feel support.&lt;/li&gt;
&lt;li style="line-height: 30px;"&gt;Java 2D.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr style="background-color: white; border-bottom-color: rgb(255, 255, 255); border-bottom-style: solid; border-image: initial; border-left: 0px; border-right: 0px; border-top-color: rgb(238, 238, 238); border-top-style: solid; font-family: Arial, sans-serif; font-size: 15px; margin: 20px 0px 20px -20px;" /&gt;
&lt;h4 style="background-color: white; box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px; color: #bf360c; font-family: roboto, sans-serif; font-size: 17.5px; line-height: 20px; margin: 10px 0px; padding: 5px; text-rendering: optimizelegibility; transition: all 0.2s ease-in-out 0s;"&gt;
AWT and Swing Hierarchy&lt;/h4&gt;
&lt;div class="center" style="background-color: white; font-family: Arial, sans-serif; font-size: 15px; margin-bottom: 10px; text-align: center !important;"&gt;
&lt;img alt="swing heirarchy" src="https://www.studytonight.com/java/images/swing-heirarchy-1.gif" style="border: 0px; height: auto; max-width: 100%; vertical-align: middle;" /&gt;&lt;/div&gt;
&lt;hr style="background-color: white; border-bottom-color: rgb(255, 255, 255); border-bottom-style: solid; border-image: initial; border-left: 0px; border-right: 0px; border-top-color: rgb(238, 238, 238); border-top-style: solid; font-family: Arial, sans-serif; font-size: 15px; margin: 20px 0px 20px -20px;" /&gt;
&lt;h4 style="background-color: white; box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px; color: #bf360c; font-family: roboto, sans-serif; font-size: 17.5px; line-height: 20px; margin: 10px 0px; padding: 5px; text-rendering: optimizelegibility; transition: all 0.2s ease-in-out 0s;"&gt;
Introduction to Swing Classes&lt;/h4&gt;
&lt;div style="background-color: white; font-family: Arial, sans-serif; font-size: 15px; margin-bottom: 10px;"&gt;
&lt;b&gt;JPanel :&lt;/b&gt;&amp;nbsp;JPanel is Swing's version of AWT class Panel and uses the same default layout, FlowLayout. JPanel is descended directly from JComponent.&lt;/div&gt;
&lt;div style="background-color: white; font-family: Arial, sans-serif; font-size: 15px; margin-bottom: 10px;"&gt;
&lt;b&gt;JFrame :&lt;/b&gt;&amp;nbsp;JFrame is Swing's version of Frame and is descended directly from&amp;nbsp;&lt;b&gt;Frame&lt;/b&gt;&amp;nbsp;class. The component which is added to the&amp;nbsp;&lt;b&gt;Frame&lt;/b&gt;, is refered as its Content.&lt;/div&gt;
&lt;div style="background-color: white; font-family: Arial, sans-serif; font-size: 15px; margin-bottom: 10px;"&gt;
&lt;b&gt;JWindow :&amp;nbsp;&lt;/b&gt;This is Swing's version of Window and has descended directly from&amp;nbsp;&lt;b&gt;Window&lt;/b&gt;&amp;nbsp;class. Like&amp;nbsp;&lt;b&gt;Window&lt;/b&gt;&amp;nbsp;it uses BorderLayout by default.&lt;/div&gt;
&lt;div style="background-color: white; font-family: Arial, sans-serif; font-size: 15px; margin-bottom: 10px;"&gt;
&lt;b&gt;JLabel :&lt;/b&gt;&amp;nbsp;JLabel has descended from JComponent, and is used to create text labels.&lt;/div&gt;
&lt;div style="background-color: white; font-family: Arial, sans-serif; font-size: 15px; margin-bottom: 10px;"&gt;
&lt;b&gt;JButton :&lt;/b&gt;&amp;nbsp;JButton class provides the functioning of push button. JButton allows an icon, string or both associated with a button.&lt;/div&gt;
&lt;div style="background-color: white; font-family: Arial, sans-serif; font-size: 15px; margin-bottom: 10px;"&gt;
&lt;b&gt;JTextField :&lt;/b&gt;&amp;nbsp;JTextFields allow editing of a single line of text.&lt;/div&gt;
&lt;hr style="background-color: white; border-bottom-color: rgb(255, 255, 255); border-bottom-style: solid; border-image: initial; border-left: 0px; border-right: 0px; border-top-color: rgb(238, 238, 238); border-top-style: solid; font-family: Arial, sans-serif; font-size: 15px; margin: 20px 0px 20px -20px;" /&gt;
&lt;h4 style="background-color: white; box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px; color: #bf360c; font-family: roboto, sans-serif; font-size: 17.5px; line-height: 20px; margin: 10px 0px; padding: 5px; text-rendering: optimizelegibility; transition: all 0.2s ease-in-out 0s;"&gt;
Creating a JFrame&lt;/h4&gt;
&lt;div style="background-color: white; font-family: Arial, sans-serif; font-size: 15px; margin-bottom: 10px;"&gt;
There are two ways to create a JFrame Window.&lt;/div&gt;
&lt;ol class="content" style="background-color: white; font-family: Arial, sans-serif; font-size: 15px; margin: 0px 0px 10px 25px; padding: 0px;"&gt;
&lt;li style="line-height: 30px;"&gt;By instantiating JFrame class.&lt;/li&gt;
&lt;li style="line-height: 30px;"&gt;By extending JFrame class.&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 style="background-color: white; box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px; color: #bf360c; font-family: roboto, sans-serif; font-size: 17.5px; line-height: 20px; margin: 10px 0px; padding: 5px; text-rendering: optimizelegibility; transition: all 0.2s ease-in-out 0s;"&gt;
Creating JFrame window by Instantiating JFrame class&lt;/h4&gt;
&lt;pre class="java language-java" style="background: rgb(30, 42, 55); border-radius: 0.3em; color: #f8f8f2; font-family: Consolas, Monaco, &amp;quot;andale mono&amp;quot;, &amp;quot;ubuntu mono&amp;quot;, monospace; font-size: 11px; hyphens: none; line-height: 1.5; margin-bottom: 0.5em; margin-top: 0.5em; overflow-wrap: normal; overflow: auto; padding: 1em; tab-size: 4; text-shadow: rgba(0, 0, 0, 0.3) 0px 1px; word-break: normal;"&gt;&lt;code class=" language-java" style="background: 0px 0px; border-radius: 0px; font-family: Consolas, Monaco, &amp;quot;andale mono&amp;quot;, &amp;quot;ubuntu mono&amp;quot;, monospace; font-size: inherit; hyphens: none; line-height: 1.5; overflow-wrap: normal; padding: 0px; tab-size: 4; text-shadow: rgba(0, 0, 0, 0.3) 0px 1px; word-break: normal; word-spacing: normal;"&gt;&lt;span class="token keyword" style="color: #66d9ef;"&gt;import&lt;/span&gt; javax&lt;span class="token punctuation"&gt;.&lt;/span&gt;swing&lt;span class="token punctuation"&gt;.&lt;/span&gt;*&lt;span class="token punctuation"&gt;;&lt;/span&gt;  &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//importing swing package&lt;/span&gt;
&lt;span class="token keyword" style="color: #66d9ef;"&gt;import&lt;/span&gt; java&lt;span class="token punctuation"&gt;.&lt;/span&gt;awt&lt;span class="token punctuation"&gt;.&lt;/span&gt;*&lt;span class="token punctuation"&gt;;&lt;/span&gt;     &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//importing awt package&lt;/span&gt;
&lt;span class="token keyword" style="color: #66d9ef;"&gt;public&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;class&lt;/span&gt; &lt;span class="token class-name"&gt;First&lt;/span&gt;
&lt;span class="token punctuation"&gt;{&lt;/span&gt;
 JFrame jf&lt;span class="token punctuation"&gt;;&lt;/span&gt;
 &lt;span class="token keyword" style="color: #66d9ef;"&gt;public&lt;/span&gt; &lt;span class="token function" style="color: #e6db74;"&gt;First&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt; &lt;span class="token punctuation"&gt;{&lt;/span&gt;
 jf &lt;span class="token operator"&gt;=&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;new&lt;/span&gt; &lt;span class="token class-name"&gt;JFrame&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string" style="color: #a6e22e;"&gt;"MyWindow"&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;  &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//Creating a JFrame with name MyWindow&lt;/span&gt;
 JButton btn &lt;span class="token operator"&gt;=&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;new&lt;/span&gt; &lt;span class="token class-name"&gt;JButton&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string" style="color: #a6e22e;"&gt;"Say Hello"&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;&lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//Creating a Button named Say Hello&lt;/span&gt;
 jf&lt;span class="token punctuation"&gt;.&lt;/span&gt;&lt;span class="token function" style="color: #e6db74;"&gt;add&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;btn&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;               &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//adding button to frame&lt;/span&gt;
 jf&lt;span class="token punctuation"&gt;.&lt;/span&gt;&lt;span class="token function" style="color: #e6db74;"&gt;setLayout&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token keyword" style="color: #66d9ef;"&gt;new&lt;/span&gt; &lt;span class="token class-name"&gt;FlowLayout&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;        &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//setting layout using FlowLayout object&lt;/span&gt;
 jf&lt;span class="token punctuation"&gt;.&lt;/span&gt;&lt;span class="token function" style="color: #e6db74;"&gt;setDefaultCloseOperation&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;JFrame&lt;span class="token punctuation"&gt;.&lt;/span&gt;EXIT_ON_CLOSE&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt; &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//setting close  operation.&lt;/span&gt;
 jf&lt;span class="token punctuation"&gt;.&lt;/span&gt;&lt;span class="token function" style="color: #e6db74;"&gt;setSize&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token number" style="color: #ae81ff;"&gt;400&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt; &lt;span class="token number" style="color: #ae81ff;"&gt;400&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;             &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//setting size&lt;/span&gt;
 jf&lt;span class="token punctuation"&gt;.&lt;/span&gt;&lt;span class="token function" style="color: #e6db74;"&gt;setVisible&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token boolean" style="color: #ae81ff;"&gt;true&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;             &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//setting frame visibility&lt;/span&gt;
&lt;span class="token punctuation"&gt;}&lt;/span&gt;
 &lt;span class="token keyword" style="color: #66d9ef;"&gt;public&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;static&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;void&lt;/span&gt; &lt;span class="token function" style="color: #e6db74;"&gt;main&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;String&lt;span class="token punctuation"&gt;[&lt;/span&gt;&lt;span class="token punctuation"&gt;]&lt;/span&gt; args&lt;span class="token punctuation"&gt;)&lt;/span&gt;
 &lt;span class="token punctuation"&gt;{&lt;/span&gt;
  &lt;span class="token keyword" style="color: #66d9ef;"&gt;new&lt;/span&gt; &lt;span class="token class-name"&gt;First&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
 &lt;span class="token punctuation"&gt;}&lt;/span&gt;
&lt;span class="token punctuation"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div class="center" style="background-color: white; font-family: Arial, sans-serif; font-size: 15px; margin-bottom: 10px; text-align: center !important;"&gt;
&lt;img alt="creating jframe using composition" src="https://www.studytonight.com/java/images/jframe-using-composition.jpg" style="border: 0px; height: auto; max-width: 100%; vertical-align: middle;" /&gt;&lt;/div&gt;
&lt;hr style="background-color: white; border-bottom-color: rgb(255, 255, 255); border-bottom-style: solid; border-image: initial; border-left: 0px; border-right: 0px; border-top-color: rgb(238, 238, 238); border-top-style: solid; font-family: Arial, sans-serif; font-size: 15px; margin: 20px 0px 20px -20px;" /&gt;
&lt;h4 style="background-color: white; box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px; color: #bf360c; font-family: roboto, sans-serif; font-size: 17.5px; line-height: 20px; margin: 10px 0px; padding: 5px; text-rendering: optimizelegibility; transition: all 0.2s ease-in-out 0s;"&gt;
Creating JFrame window by extending JFrame class&lt;/h4&gt;
&lt;pre class="java language-java" style="background: rgb(30, 42, 55); border-radius: 0.3em; color: #f8f8f2; font-family: Consolas, Monaco, &amp;quot;andale mono&amp;quot;, &amp;quot;ubuntu mono&amp;quot;, monospace; font-size: 11px; hyphens: none; line-height: 1.5; margin-bottom: 0.5em; margin-top: 0.5em; overflow-wrap: normal; overflow: auto; padding: 1em; tab-size: 4; text-shadow: rgba(0, 0, 0, 0.3) 0px 1px; word-break: normal;"&gt;&lt;code class=" language-java" style="background: 0px 0px; border-radius: 0px; font-family: Consolas, Monaco, &amp;quot;andale mono&amp;quot;, &amp;quot;ubuntu mono&amp;quot;, monospace; font-size: inherit; hyphens: none; line-height: 1.5; overflow-wrap: normal; padding: 0px; tab-size: 4; text-shadow: rgba(0, 0, 0, 0.3) 0px 1px; word-break: normal; word-spacing: normal;"&gt;&lt;span class="token keyword" style="color: #66d9ef;"&gt;import&lt;/span&gt; javax&lt;span class="token punctuation"&gt;.&lt;/span&gt;swing&lt;span class="token punctuation"&gt;.&lt;/span&gt;*&lt;span class="token punctuation"&gt;;&lt;/span&gt; &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//importing swing package&lt;/span&gt;
&lt;span class="token keyword" style="color: #66d9ef;"&gt;import&lt;/span&gt; java&lt;span class="token punctuation"&gt;.&lt;/span&gt;awt&lt;span class="token punctuation"&gt;.&lt;/span&gt;*&lt;span class="token punctuation"&gt;;&lt;/span&gt; &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//importing awt package&lt;/span&gt;
&lt;span class="token keyword" style="color: #66d9ef;"&gt;public&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;class&lt;/span&gt; &lt;span class="token class-name"&gt;Second&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;extends&lt;/span&gt; &lt;span class="token class-name"&gt;JFrame&lt;/span&gt;
&lt;span class="token punctuation"&gt;{&lt;/span&gt;
 &lt;span class="token keyword" style="color: #66d9ef;"&gt;public&lt;/span&gt; &lt;span class="token function" style="color: #e6db74;"&gt;Second&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;
 &lt;span class="token punctuation"&gt;{&lt;/span&gt;
  &lt;span class="token function" style="color: #e6db74;"&gt;setTitle&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string" style="color: #a6e22e;"&gt;"MyWindow"&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt; &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//setting title of frame as  MyWindow&lt;/span&gt;
  JLabel lb &lt;span class="token operator"&gt;=&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;new&lt;/span&gt; &lt;span class="token class-name"&gt;JLabel&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string" style="color: #a6e22e;"&gt;"Welcome to My Second Window"&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;&lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//Creating a label named Welcome to My Second Window&lt;/span&gt;
  &lt;span class="token function" style="color: #e6db74;"&gt;add&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;lb&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;   &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//adding label to frame.&lt;/span&gt;
  &lt;span class="token function" style="color: #e6db74;"&gt;setLayout&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token keyword" style="color: #66d9ef;"&gt;new&lt;/span&gt; &lt;span class="token class-name"&gt;FlowLayout&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt; &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//setting layout using FlowLayout object.&lt;/span&gt;
  &lt;span class="token function" style="color: #e6db74;"&gt;setDefaultCloseOperation&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;JFrame&lt;span class="token punctuation"&gt;.&lt;/span&gt;EXIT_ON_CLOSE&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt; &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//setting close operation.&lt;/span&gt;
  &lt;span class="token function" style="color: #e6db74;"&gt;setSize&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token number" style="color: #ae81ff;"&gt;400&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt; &lt;span class="token number" style="color: #ae81ff;"&gt;400&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;  &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//setting size&lt;/span&gt;
  &lt;span class="token function" style="color: #e6db74;"&gt;setVisible&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token boolean" style="color: #ae81ff;"&gt;true&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;  &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//setting frame visibility&lt;/span&gt;
 &lt;span class="token punctuation"&gt;}&lt;/span&gt;
 &lt;span class="token keyword" style="color: #66d9ef;"&gt;public&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;static&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;void&lt;/span&gt; &lt;span class="token function" style="color: #e6db74;"&gt;main&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;String&lt;span class="token punctuation"&gt;[&lt;/span&gt;&lt;span class="token punctuation"&gt;]&lt;/span&gt; args&lt;span class="token punctuation"&gt;)&lt;/span&gt;
 &lt;span class="token punctuation"&gt;{&lt;/span&gt;
  &lt;span class="token keyword" style="color: #66d9ef;"&gt;new&lt;/span&gt; &lt;span class="token class-name"&gt;Second&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
 &lt;span class="token punctuation"&gt;}&lt;/span&gt;
&lt;span class="token punctuation"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div class="center" style="background-color: white; font-family: Arial, sans-serif; font-size: 15px; margin-bottom: 10px; text-align: center !important;"&gt;
&lt;img alt="creating jframe using inheritance" src="https://www.studytonight.com/java/images/jframe-using-inheritance.jpg" style="border: 0px; height: auto; max-width: 100%; vertical-align: middle;" /&gt;&lt;/div&gt;
&lt;hr style="background-color: white; border-bottom-color: rgb(255, 255, 255); border-bottom-style: solid; border-image: initial; border-left: 0px; border-right: 0px; border-top-color: rgb(238, 238, 238); border-top-style: solid; font-family: Arial, sans-serif; font-size: 15px; margin: 20px 0px 20px -20px;" /&gt;
&lt;h4 style="background-color: white; box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px; color: #bf360c; font-family: roboto, sans-serif; font-size: 17.5px; line-height: 20px; margin: 10px 0px; padding: 5px; text-rendering: optimizelegibility; transition: all 0.2s ease-in-out 0s;"&gt;
Points To Remember&lt;/h4&gt;
&lt;ol class="content" style="background-color: white; font-family: Arial, sans-serif; font-size: 15px; margin: 0px 0px 10px 25px; padding: 0px;"&gt;
&lt;li style="line-height: 30px;"&gt;Import the javax.swing and java.awt package to use the classes and methods of Swing.&lt;/li&gt;
&lt;li style="line-height: 30px;"&gt;While creating a frame (either by instantiating or extending Frame class), following two attributes are must for visibility of the frame:&lt;pre class="java language-java" style="background: rgb(30, 42, 55); border-radius: 0.3em; color: #f8f8f2; font-family: Consolas, Monaco, &amp;quot;andale mono&amp;quot;, &amp;quot;ubuntu mono&amp;quot;, monospace; font-size: 11px; hyphens: none; line-height: 1.5; margin-bottom: 0.5em; margin-top: 0.5em; overflow-wrap: normal; overflow: auto; padding: 1em; tab-size: 4; text-shadow: rgba(0, 0, 0, 0.3) 0px 1px; word-break: normal; word-spacing: normal;"&gt;&lt;code class=" language-java" style="background: 0px 0px; border-radius: 0px; font-family: Consolas, Monaco, &amp;quot;andale mono&amp;quot;, &amp;quot;ubuntu mono&amp;quot;, monospace; font-size: inherit; hyphens: none; line-height: 1.5; overflow-wrap: normal; padding: 0px; tab-size: 4; text-shadow: rgba(0, 0, 0, 0.3) 0px 1px; word-break: normal; word-spacing: normal;"&gt;&lt;span class="token function" style="color: #e6db74;"&gt;setSize&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token keyword" style="color: #66d9ef;"&gt;int&lt;/span&gt; width&lt;span class="token punctuation"&gt;,&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;int&lt;/span&gt; height&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
&lt;span class="token function" style="color: #e6db74;"&gt;setVisible&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token boolean" style="color: #ae81ff;"&gt;true&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li style="line-height: 30px;"&gt;When you create objects of other components like Buttons, TextFields, etc. Then you need to add it to the frame by using the method -&amp;nbsp;&lt;b&gt;add(Component's Object);&lt;/b&gt;&lt;/li&gt;
&lt;li style="line-height: 30px;"&gt;You can add the following method also for resizing the frame -&amp;nbsp;&lt;b&gt;setResizable(true)&lt;/b&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , sans-serif;"&gt;&lt;span style="font-size: 15px;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;h3 style="background-color: white; font-family: roboto, sans-serif; font-size: 24.5px; line-height: 40px; margin: 5px 0px; text-rendering: optimizelegibility;"&gt;
Swing Components and Containers&lt;/h3&gt;
&lt;div style="background-color: white; font-family: Arial, sans-serif; font-size: 15px; margin-bottom: 10px;"&gt;
A component is an independent visual control. Swing Framework contains a large set of components which provide rich functionalities and allow high level of customization. They all are derived from JComponent class. All these components are lightweight components. This class provides some common functionality like pluggable look and feel, support for accessibility, drag and drop, layout, etc.&lt;/div&gt;
&lt;div style="background-color: white; font-family: Arial, sans-serif; font-size: 15px; margin-bottom: 10px;"&gt;
A container holds a group of components. It provides a space where a component can be managed and displayed. Containers are of two types:&lt;/div&gt;
&lt;ol class="content" style="background-color: white; font-family: Arial, sans-serif; font-size: 15px; margin: 0px 0px 10px 25px; padding: 0px;"&gt;
&lt;li style="line-height: 30px;"&gt;&lt;b&gt;Top level Containers&lt;/b&gt;&lt;/li&gt;
&lt;ul class="content" style="margin: 0px 0px 0px 25px; padding: 0px;"&gt;
&lt;li style="line-height: 30px;"&gt;It inherits Component and Container of AWT.&lt;/li&gt;
&lt;li style="line-height: 30px;"&gt;It cannot be contained within other containers.&lt;/li&gt;
&lt;li style="line-height: 30px;"&gt;Heavyweight.&lt;/li&gt;
&lt;li style="line-height: 30px;"&gt;Example: JFrame, JDialog, JApplet&lt;/li&gt;
&lt;/ul&gt;
&lt;li style="line-height: 30px;"&gt;&lt;b&gt;Lightweight Containers&lt;/b&gt;&lt;ul class="content" style="margin: 0px 0px 0px 25px; padding: 0px;"&gt;
&lt;li style="line-height: 30px;"&gt;It inherits JComponent class.&lt;/li&gt;
&lt;li style="line-height: 30px;"&gt;It is a general purpose container.&lt;/li&gt;
&lt;li style="line-height: 30px;"&gt;It can be used to organize related components together.&lt;/li&gt;
&lt;li style="line-height: 30px;"&gt;Example: JPanel&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;hr style="background-color: white; border-bottom-color: rgb(255, 255, 255); border-bottom-style: solid; border-image: initial; border-left: 0px; border-right: 0px; border-top-color: rgb(238, 238, 238); border-top-style: solid; font-family: Arial, sans-serif; font-size: 15px; margin: 20px 0px 20px -20px;" /&gt;
&lt;h4 style="background-color: white; box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px; color: #bf360c; font-family: roboto, sans-serif; font-size: 17.5px; line-height: 20px; margin: 10px 0px; padding: 5px; text-rendering: optimizelegibility; transition: all 0.2s ease-in-out 0s;"&gt;
JButton&lt;/h4&gt;
&lt;div style="background-color: white; font-family: Arial, sans-serif; font-size: 15px; margin-bottom: 10px;"&gt;
&lt;b&gt;JButton&lt;/b&gt;&amp;nbsp;class provides functionality of a button. JButton class has three constuctors,&lt;/div&gt;
&lt;pre class="java language-java" style="background: rgb(30, 42, 55); border-radius: 0.3em; color: #f8f8f2; font-family: Consolas, Monaco, &amp;quot;andale mono&amp;quot;, &amp;quot;ubuntu mono&amp;quot;, monospace; font-size: 11px; hyphens: none; line-height: 1.5; margin-bottom: 0.5em; margin-top: 0.5em; overflow-wrap: normal; overflow: auto; padding: 1em; tab-size: 4; text-shadow: rgba(0, 0, 0, 0.3) 0px 1px; word-break: normal;"&gt;&lt;code class=" language-java" style="background: 0px 0px; border-radius: 0px; font-family: Consolas, Monaco, &amp;quot;andale mono&amp;quot;, &amp;quot;ubuntu mono&amp;quot;, monospace; font-size: inherit; hyphens: none; line-height: 1.5; overflow-wrap: normal; padding: 0px; tab-size: 4; text-shadow: rgba(0, 0, 0, 0.3) 0px 1px; word-break: normal; word-spacing: normal;"&gt;&lt;span class="token function" style="color: #e6db74;"&gt;JButton&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;Icon ic&lt;span class="token punctuation"&gt;)&lt;/span&gt;

&lt;span class="token function" style="color: #e6db74;"&gt;JButton&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;String str&lt;span class="token punctuation"&gt;)&lt;/span&gt;

&lt;span class="token function" style="color: #e6db74;"&gt;JButton&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;String str&lt;span class="token punctuation"&gt;,&lt;/span&gt; Icon ic&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div style="background-color: white; font-family: Arial, sans-serif; font-size: 15px; margin-bottom: 10px;"&gt;
It allows a button to be created using icon, a string or both. JButton supports&amp;nbsp;&lt;b&gt;ActionEvent&lt;/b&gt;. When a button is pressed an&amp;nbsp;&lt;b&gt;ActionEvent&lt;/b&gt;&amp;nbsp;is generated.&lt;/div&gt;
&lt;hr style="background-color: white; border-bottom-color: rgb(255, 255, 255); border-bottom-style: solid; border-image: initial; border-left: 0px; border-right: 0px; border-top-color: rgb(238, 238, 238); border-top-style: solid; font-family: Arial, sans-serif; font-size: 15px; margin: 20px 0px 20px -20px;" /&gt;
&lt;h4 style="background-color: white; box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px; color: #bf360c; font-family: roboto, sans-serif; font-size: 17.5px; line-height: 20px; margin: 10px 0px; padding: 5px; text-rendering: optimizelegibility; transition: all 0.2s ease-in-out 0s;"&gt;
Example using JButton&lt;/h4&gt;
&lt;pre class="java language-java" style="background: rgb(30, 42, 55); border-radius: 0.3em; color: #f8f8f2; font-family: Consolas, Monaco, &amp;quot;andale mono&amp;quot;, &amp;quot;ubuntu mono&amp;quot;, monospace; font-size: 11px; hyphens: none; line-height: 1.5; margin-bottom: 0.5em; margin-top: 0.5em; overflow-wrap: normal; overflow: auto; padding: 1em; tab-size: 4; text-shadow: rgba(0, 0, 0, 0.3) 0px 1px; word-break: normal;"&gt;&lt;code class=" language-java" style="background: 0px 0px; border-radius: 0px; font-family: Consolas, Monaco, &amp;quot;andale mono&amp;quot;, &amp;quot;ubuntu mono&amp;quot;, monospace; font-size: inherit; hyphens: none; line-height: 1.5; overflow-wrap: normal; padding: 0px; tab-size: 4; text-shadow: rgba(0, 0, 0, 0.3) 0px 1px; word-break: normal; word-spacing: normal;"&gt;&lt;span class="token keyword" style="color: #66d9ef;"&gt;import&lt;/span&gt; javax&lt;span class="token punctuation"&gt;.&lt;/span&gt;swing&lt;span class="token punctuation"&gt;.&lt;/span&gt;*&lt;span class="token punctuation"&gt;;&lt;/span&gt;
&lt;span class="token keyword" style="color: #66d9ef;"&gt;import&lt;/span&gt; java&lt;span class="token punctuation"&gt;.&lt;/span&gt;awt&lt;span class="token punctuation"&gt;.&lt;/span&gt;event&lt;span class="token punctuation"&gt;.&lt;/span&gt;*&lt;span class="token punctuation"&gt;;&lt;/span&gt;
&lt;span class="token keyword" style="color: #66d9ef;"&gt;import&lt;/span&gt; java&lt;span class="token punctuation"&gt;.&lt;/span&gt;awt&lt;span class="token punctuation"&gt;.&lt;/span&gt;*&lt;span class="token punctuation"&gt;;&lt;/span&gt;
&lt;span class="token keyword" style="color: #66d9ef;"&gt;public&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;class&lt;/span&gt; &lt;span class="token class-name"&gt;testswing&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;extends&lt;/span&gt; &lt;span class="token class-name"&gt;JFrame&lt;/span&gt;
&lt;span class="token punctuation"&gt;{&lt;/span&gt;

 &lt;span class="token function" style="color: #e6db74;"&gt;testswing&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;
 &lt;span class="token punctuation"&gt;{&lt;/span&gt;
  JButton bt1 &lt;span class="token operator"&gt;=&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;new&lt;/span&gt; &lt;span class="token class-name"&gt;JButton&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string" style="color: #a6e22e;"&gt;"Yes"&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;  &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//Creating a Yes Button.&lt;/span&gt;
  JButton bt2 &lt;span class="token operator"&gt;=&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;new&lt;/span&gt; &lt;span class="token class-name"&gt;JButton&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string" style="color: #a6e22e;"&gt;"No"&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;  &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//Creating a No Button.&lt;/span&gt;
  &lt;span class="token function" style="color: #e6db74;"&gt;setDefaultCloseOperation&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;JFrame&lt;span class="token punctuation"&gt;.&lt;/span&gt;EXIT_ON_CLOSE&lt;span class="token punctuation"&gt;)&lt;/span&gt;     &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//setting close operation.&lt;/span&gt;
  &lt;span class="token function" style="color: #e6db74;"&gt;setLayout&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token keyword" style="color: #66d9ef;"&gt;new&lt;/span&gt; &lt;span class="token class-name"&gt;FlowLayout&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;  &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//setting layout using FlowLayout object&lt;/span&gt;
  &lt;span class="token function" style="color: #e6db74;"&gt;setSize&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token number" style="color: #ae81ff;"&gt;400&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt; &lt;span class="token number" style="color: #ae81ff;"&gt;400&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;   &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//setting size of Jframe&lt;/span&gt;
  &lt;span class="token function" style="color: #e6db74;"&gt;add&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;bt1&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;  &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//adding Yes button to frame.&lt;/span&gt;
  &lt;span class="token function" style="color: #e6db74;"&gt;add&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;bt2&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;  &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//adding No button to frame.&lt;/span&gt;

  &lt;span class="token function" style="color: #e6db74;"&gt;setVisible&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token boolean" style="color: #ae81ff;"&gt;true&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
 &lt;span class="token punctuation"&gt;}&lt;/span&gt;
 &lt;span class="token keyword" style="color: #66d9ef;"&gt;public&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;static&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;void&lt;/span&gt; &lt;span class="token function" style="color: #e6db74;"&gt;main&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;String&lt;span class="token punctuation"&gt;[&lt;/span&gt;&lt;span class="token punctuation"&gt;]&lt;/span&gt; args&lt;span class="token punctuation"&gt;)&lt;/span&gt;
 &lt;span class="token punctuation"&gt;{&lt;/span&gt;
  &lt;span class="token keyword" style="color: #66d9ef;"&gt;new&lt;/span&gt; &lt;span class="token class-name"&gt;testswing&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
 &lt;span class="token punctuation"&gt;}&lt;/span&gt;
&lt;span class="token punctuation"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div class="center" style="background-color: white; font-family: Arial, sans-serif; font-size: 15px; margin-bottom: 10px; text-align: center !important;"&gt;
&lt;img alt="swing button example" src="https://www.studytonight.com/java/images/swing-program.jpg" style="border: 0px; height: auto; max-width: 100%; vertical-align: middle;" /&gt;&lt;/div&gt;
&lt;hr style="background-color: white; border-bottom-color: rgb(255, 255, 255); border-bottom-style: solid; border-image: initial; border-left: 0px; border-right: 0px; border-top-color: rgb(238, 238, 238); border-top-style: solid; font-family: Arial, sans-serif; font-size: 15px; margin: 20px 0px 20px -20px;" /&gt;
&lt;h4 style="background-color: white; box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px; color: #bf360c; font-family: roboto, sans-serif; font-size: 17.5px; line-height: 20px; margin: 10px 0px; padding: 5px; text-rendering: optimizelegibility; transition: all 0.2s ease-in-out 0s;"&gt;
JTextField&lt;/h4&gt;
&lt;div style="background-color: white; font-family: Arial, sans-serif; font-size: 15px; margin-bottom: 10px;"&gt;
&lt;b&gt;JTextField&lt;/b&gt;&amp;nbsp;is used for taking input of single line of text. It is most widely used text component. It has three constructors,&lt;/div&gt;
&lt;pre class="java language-java" style="background: rgb(30, 42, 55); border-radius: 0.3em; color: #f8f8f2; font-family: Consolas, Monaco, &amp;quot;andale mono&amp;quot;, &amp;quot;ubuntu mono&amp;quot;, monospace; font-size: 11px; hyphens: none; line-height: 1.5; margin-bottom: 0.5em; margin-top: 0.5em; overflow-wrap: normal; overflow: auto; padding: 1em; tab-size: 4; text-shadow: rgba(0, 0, 0, 0.3) 0px 1px; word-break: normal;"&gt;&lt;code class=" language-java" style="background: 0px 0px; border-radius: 0px; font-family: Consolas, Monaco, &amp;quot;andale mono&amp;quot;, &amp;quot;ubuntu mono&amp;quot;, monospace; font-size: inherit; hyphens: none; line-height: 1.5; overflow-wrap: normal; padding: 0px; tab-size: 4; text-shadow: rgba(0, 0, 0, 0.3) 0px 1px; word-break: normal; word-spacing: normal;"&gt;&lt;span class="token function" style="color: #e6db74;"&gt;JTextField&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token keyword" style="color: #66d9ef;"&gt;int&lt;/span&gt; cols&lt;span class="token punctuation"&gt;)&lt;/span&gt;
&lt;span class="token function" style="color: #e6db74;"&gt;JTextField&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;String str&lt;span class="token punctuation"&gt;,&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;int&lt;/span&gt; cols&lt;span class="token punctuation"&gt;)&lt;/span&gt;
&lt;span class="token function" style="color: #e6db74;"&gt;JTextField&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;String str&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div style="background-color: white; font-family: Arial, sans-serif; font-size: 15px; margin-bottom: 10px;"&gt;
&lt;i&gt;cols&lt;/i&gt;&amp;nbsp;represent the number of columns in text field.&lt;/div&gt;
&lt;hr style="background-color: white; border-bottom-color: rgb(255, 255, 255); border-bottom-style: solid; border-image: initial; border-left: 0px; border-right: 0px; border-top-color: rgb(238, 238, 238); border-top-style: solid; font-family: Arial, sans-serif; font-size: 15px; margin: 20px 0px 20px -20px;" /&gt;
&lt;h4 style="background-color: white; box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px; color: #bf360c; font-family: roboto, sans-serif; font-size: 17.5px; line-height: 20px; margin: 10px 0px; padding: 5px; text-rendering: optimizelegibility; transition: all 0.2s ease-in-out 0s;"&gt;
Example using JTextField&lt;/h4&gt;
&lt;pre class="java language-java" style="background: rgb(30, 42, 55); border-radius: 0.3em; color: #f8f8f2; font-family: Consolas, Monaco, &amp;quot;andale mono&amp;quot;, &amp;quot;ubuntu mono&amp;quot;, monospace; font-size: 11px; hyphens: none; line-height: 1.5; margin-bottom: 0.5em; margin-top: 0.5em; overflow-wrap: normal; overflow: auto; padding: 1em; tab-size: 4; text-align: left; text-shadow: rgba(0, 0, 0, 0.3) 0px 1px; word-break: normal;"&gt;&lt;code class=" language-java" style="background: 0px 0px; border-radius: 0px; font-family: Consolas, Monaco, &amp;quot;andale mono&amp;quot;, &amp;quot;ubuntu mono&amp;quot;, monospace; font-size: inherit; hyphens: none; line-height: 1.5; overflow-wrap: normal; padding: 0px; tab-size: 4; text-shadow: rgba(0, 0, 0, 0.3) 0px 1px; word-break: normal; word-spacing: normal;"&gt;&lt;span class="token keyword" style="color: #66d9ef;"&gt;import&lt;/span&gt; javax&lt;span class="token punctuation"&gt;.&lt;/span&gt;swing&lt;span class="token punctuation"&gt;.&lt;/span&gt;*&lt;span class="token punctuation"&gt;;&lt;/span&gt;
&lt;span class="token keyword" style="color: #66d9ef;"&gt;import&lt;/span&gt; java&lt;span class="token punctuation"&gt;.&lt;/span&gt;awt&lt;span class="token punctuation"&gt;.&lt;/span&gt;event&lt;span class="token punctuation"&gt;.&lt;/span&gt;*&lt;span class="token punctuation"&gt;;&lt;/span&gt;
&lt;span class="token keyword" style="color: #66d9ef;"&gt;import&lt;/span&gt; java&lt;span class="token punctuation"&gt;.&lt;/span&gt;awt&lt;span class="token punctuation"&gt;.&lt;/span&gt;*&lt;span class="token punctuation"&gt;;&lt;/span&gt;
&lt;span class="token keyword" style="color: #66d9ef;"&gt;public&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;class&lt;/span&gt; &lt;span class="token class-name"&gt;MyTextField&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;extends&lt;/span&gt; &lt;span class="token class-name"&gt;JFrame&lt;/span&gt;
&lt;span class="token punctuation"&gt;{&lt;/span&gt;
 &lt;span class="token keyword" style="color: #66d9ef;"&gt;public&lt;/span&gt; &lt;span class="token function" style="color: #e6db74;"&gt;MyTextField&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;
 &lt;span class="token punctuation"&gt;{&lt;/span&gt;
  JTextField jtf &lt;span class="token operator"&gt;=&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;new&lt;/span&gt; &lt;span class="token class-name"&gt;JTextField&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token number" style="color: #ae81ff;"&gt;20&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt; &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//creating JTextField.&lt;/span&gt;
  &lt;span class="token function" style="color: #e6db74;"&gt;add&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;jtf&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;    &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//adding JTextField to frame.&lt;/span&gt;
  &lt;span class="token function" style="color: #e6db74;"&gt;setLayout&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token keyword" style="color: #66d9ef;"&gt;new&lt;/span&gt; &lt;span class="token class-name"&gt;FlowLayout&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
  &lt;span class="token function" style="color: #e6db74;"&gt;setDefaultCloseOperation&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;JFrame&lt;span class="token punctuation"&gt;.&lt;/span&gt;EXIT_ON_CLOSE&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
  &lt;span class="token function" style="color: #e6db74;"&gt;setSize&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token number" style="color: #ae81ff;"&gt;400&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt; &lt;span class="token number" style="color: #ae81ff;"&gt;400&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
  &lt;span class="token function" style="color: #e6db74;"&gt;setVisible&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token boolean" style="color: #ae81ff;"&gt;true&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
 &lt;span class="token punctuation"&gt;}&lt;/span&gt;
 &lt;span class="token keyword" style="color: #66d9ef;"&gt;public&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;static&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;void&lt;/span&gt; &lt;span class="token function" style="color: #e6db74;"&gt;main&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;String&lt;span class="token punctuation"&gt;[&lt;/span&gt;&lt;span class="token punctuation"&gt;]&lt;/span&gt; args&lt;span class="token punctuation"&gt;)&lt;/span&gt;
 &lt;span class="token punctuation"&gt;{&lt;/span&gt;
  &lt;span class="token keyword" style="color: #66d9ef;"&gt;new&lt;/span&gt; &lt;span class="token class-name"&gt;MyTextField&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
 &lt;span class="token punctuation"&gt;}&lt;/span&gt;
&lt;span class="token punctuation"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h4 style="background-color: white; box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px; color: #bf360c; font-family: roboto, sans-serif; font-size: 17.5px; line-height: 20px; margin: 10px 0px; padding: 5px; text-rendering: optimizelegibility; transition: all 0.2s ease-in-out 0s;"&gt;
JCheckBox&lt;/h4&gt;
&lt;div style="background-color: white; font-family: Arial, sans-serif; font-size: 15px; margin-bottom: 10px;"&gt;
&lt;b&gt;JCheckBox&lt;/b&gt;&amp;nbsp;class is used to create checkboxes in frame. Following is constructor for JCheckBox,&lt;/div&gt;
&lt;pre class="java language-java" style="background: rgb(30, 42, 55); border-radius: 0.3em; color: #f8f8f2; font-family: Consolas, Monaco, &amp;quot;andale mono&amp;quot;, &amp;quot;ubuntu mono&amp;quot;, monospace; font-size: 11px; hyphens: none; line-height: 1.5; margin-bottom: 0.5em; margin-top: 0.5em; overflow-wrap: normal; overflow: auto; padding: 1em; tab-size: 4; text-shadow: rgba(0, 0, 0, 0.3) 0px 1px; word-break: normal;"&gt;&lt;code class=" language-java" style="background: 0px 0px; border-radius: 0px; font-family: Consolas, Monaco, &amp;quot;andale mono&amp;quot;, &amp;quot;ubuntu mono&amp;quot;, monospace; font-size: inherit; hyphens: none; line-height: 1.5; overflow-wrap: normal; padding: 0px; tab-size: 4; text-shadow: rgba(0, 0, 0, 0.3) 0px 1px; word-break: normal; word-spacing: normal;"&gt;&lt;span class="token function" style="color: #e6db74;"&gt;JCheckBox&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;String str&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;hr style="background-color: white; border-bottom-color: rgb(255, 255, 255); border-bottom-style: solid; border-image: initial; border-left: 0px; border-right: 0px; border-top-color: rgb(238, 238, 238); border-top-style: solid; font-family: Arial, sans-serif; font-size: 15px; margin: 20px 0px 20px -20px;" /&gt;
&lt;h4 style="background-color: white; box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px; color: #bf360c; font-family: roboto, sans-serif; font-size: 17.5px; line-height: 20px; margin: 10px 0px; padding: 5px; text-rendering: optimizelegibility; transition: all 0.2s ease-in-out 0s;"&gt;
Example using JCheckBox&lt;/h4&gt;
&lt;pre class="java language-java" style="background: rgb(30, 42, 55); border-radius: 0.3em; color: #f8f8f2; font-family: Consolas, Monaco, &amp;quot;andale mono&amp;quot;, &amp;quot;ubuntu mono&amp;quot;, monospace; font-size: 11px; hyphens: none; line-height: 1.5; margin-bottom: 0.5em; margin-top: 0.5em; overflow-wrap: normal; overflow: auto; padding: 1em; tab-size: 4; text-shadow: rgba(0, 0, 0, 0.3) 0px 1px; word-break: normal;"&gt;&lt;code class=" language-java" style="background: 0px 0px; border-radius: 0px; font-family: Consolas, Monaco, &amp;quot;andale mono&amp;quot;, &amp;quot;ubuntu mono&amp;quot;, monospace; font-size: inherit; hyphens: none; line-height: 1.5; overflow-wrap: normal; padding: 0px; tab-size: 4; text-shadow: rgba(0, 0, 0, 0.3) 0px 1px; word-break: normal; word-spacing: normal;"&gt;&lt;span class="token keyword" style="color: #66d9ef;"&gt;import&lt;/span&gt; javax&lt;span class="token punctuation"&gt;.&lt;/span&gt;swing&lt;span class="token punctuation"&gt;.&lt;/span&gt;*&lt;span class="token punctuation"&gt;;&lt;/span&gt;
&lt;span class="token keyword" style="color: #66d9ef;"&gt;import&lt;/span&gt; java&lt;span class="token punctuation"&gt;.&lt;/span&gt;awt&lt;span class="token punctuation"&gt;.&lt;/span&gt;event&lt;span class="token punctuation"&gt;.&lt;/span&gt;*&lt;span class="token punctuation"&gt;;&lt;/span&gt;
&lt;span class="token keyword" style="color: #66d9ef;"&gt;import&lt;/span&gt; java&lt;span class="token punctuation"&gt;.&lt;/span&gt;awt&lt;span class="token punctuation"&gt;.&lt;/span&gt;*&lt;span class="token punctuation"&gt;;&lt;/span&gt;
&lt;span class="token keyword" style="color: #66d9ef;"&gt;public&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;class&lt;/span&gt; &lt;span class="token class-name"&gt;Test&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;extends&lt;/span&gt; &lt;span class="token class-name"&gt;JFrame&lt;/span&gt;
&lt;span class="token punctuation"&gt;{&lt;/span&gt;
 &lt;span class="token keyword" style="color: #66d9ef;"&gt;public&lt;/span&gt; &lt;span class="token function" style="color: #e6db74;"&gt;Test&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;
 &lt;span class="token punctuation"&gt;{&lt;/span&gt;
  JCheckBox jcb &lt;span class="token operator"&gt;=&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;new&lt;/span&gt; &lt;span class="token class-name"&gt;JCheckBox&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string" style="color: #a6e22e;"&gt;"yes"&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;   &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//creating JCheckBox.&lt;/span&gt;
  &lt;span class="token function" style="color: #e6db74;"&gt;add&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;jcb&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;      &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//adding JCheckBox to frame.&lt;/span&gt;
  jcb &lt;span class="token operator"&gt;=&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;new&lt;/span&gt; &lt;span class="token class-name"&gt;JCheckBox&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string" style="color: #a6e22e;"&gt;"no"&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;    &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//creating JCheckBox.&lt;/span&gt;
  &lt;span class="token function" style="color: #e6db74;"&gt;add&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;jcb&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;      &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//adding JCheckBox to frame.&lt;/span&gt;
  jcb &lt;span class="token operator"&gt;=&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;new&lt;/span&gt; &lt;span class="token class-name"&gt;JCheckBox&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string" style="color: #a6e22e;"&gt;"maybe"&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;    &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//creating JCheckBox.&lt;/span&gt;
  &lt;span class="token function" style="color: #e6db74;"&gt;add&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;jcb&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;      &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//adding JCheckBox to frame.&lt;/span&gt;
  &lt;span class="token function" style="color: #e6db74;"&gt;setLayout&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token keyword" style="color: #66d9ef;"&gt;new&lt;/span&gt; &lt;span class="token class-name"&gt;FlowLayout&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
  &lt;span class="token function" style="color: #e6db74;"&gt;setDefaultCloseOperation&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;JFrame&lt;span class="token punctuation"&gt;.&lt;/span&gt;EXIT_ON_CLOSE&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
  &lt;span class="token function" style="color: #e6db74;"&gt;setSize&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token number" style="color: #ae81ff;"&gt;400&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt; &lt;span class="token number" style="color: #ae81ff;"&gt;400&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
  &lt;span class="token function" style="color: #e6db74;"&gt;setVisible&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token boolean" style="color: #ae81ff;"&gt;true&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
 &lt;span class="token punctuation"&gt;}&lt;/span&gt;
 &lt;span class="token keyword" style="color: #66d9ef;"&gt;public&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;static&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;void&lt;/span&gt; &lt;span class="token function" style="color: #e6db74;"&gt;main&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;String&lt;span class="token punctuation"&gt;[&lt;/span&gt;&lt;span class="token punctuation"&gt;]&lt;/span&gt; args&lt;span class="token punctuation"&gt;)&lt;/span&gt;
 &lt;span class="token punctuation"&gt;{&lt;/span&gt;
  &lt;span class="token keyword" style="color: #66d9ef;"&gt;new&lt;/span&gt; &lt;span class="token class-name"&gt;Test&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
 &lt;span class="token punctuation"&gt;}&lt;/span&gt;
&lt;span class="token punctuation"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div class="center" style="background-color: white; font-family: Arial, sans-serif; font-size: 15px; margin-bottom: 10px; text-align: center !important;"&gt;
&lt;img alt="jcheckbox example" src="https://www.studytonight.com/java/images/jcheckbox-example.jpg" style="border: 0px; height: auto; max-width: 100%; vertical-align: middle;" /&gt;&lt;/div&gt;
&lt;hr style="background-color: white; border-bottom-color: rgb(255, 255, 255); border-bottom-style: solid; border-image: initial; border-left: 0px; border-right: 0px; border-top-color: rgb(238, 238, 238); border-top-style: solid; font-family: Arial, sans-serif; font-size: 15px; margin: 20px 0px 20px -20px;" /&gt;
&lt;h4 style="background-color: white; box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px; color: #bf360c; font-family: roboto, sans-serif; font-size: 17.5px; line-height: 20px; margin: 10px 0px; padding: 5px; text-rendering: optimizelegibility; transition: all 0.2s ease-in-out 0s;"&gt;
JRadioButton&lt;/h4&gt;
&lt;div style="background-color: white; font-family: Arial, sans-serif; font-size: 15px; margin-bottom: 10px;"&gt;
Radio button is a group of related button in which only one can be selected. JRadioButton class is used to create a radio button in Frames. Following is the constructor for JRadioButton,&lt;/div&gt;
&lt;pre class="java language-java" style="background: rgb(30, 42, 55); border-radius: 0.3em; color: #f8f8f2; font-family: Consolas, Monaco, &amp;quot;andale mono&amp;quot;, &amp;quot;ubuntu mono&amp;quot;, monospace; font-size: 11px; hyphens: none; line-height: 1.5; margin-bottom: 0.5em; margin-top: 0.5em; overflow-wrap: normal; overflow: auto; padding: 1em; tab-size: 4; text-shadow: rgba(0, 0, 0, 0.3) 0px 1px; word-break: normal;"&gt;&lt;code class=" language-java" style="background: 0px 0px; border-radius: 0px; font-family: Consolas, Monaco, &amp;quot;andale mono&amp;quot;, &amp;quot;ubuntu mono&amp;quot;, monospace; font-size: inherit; hyphens: none; line-height: 1.5; overflow-wrap: normal; padding: 0px; tab-size: 4; text-shadow: rgba(0, 0, 0, 0.3) 0px 1px; word-break: normal; word-spacing: normal;"&gt;&lt;span class="token function" style="color: #e6db74;"&gt;JRadioButton&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;String str&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;hr style="background-color: white; border-bottom-color: rgb(255, 255, 255); border-bottom-style: solid; border-image: initial; border-left: 0px; border-right: 0px; border-top-color: rgb(238, 238, 238); border-top-style: solid; font-family: Arial, sans-serif; font-size: 15px; margin: 20px 0px 20px -20px;" /&gt;
&lt;h4 style="background-color: white; box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px; color: #bf360c; font-family: roboto, sans-serif; font-size: 17.5px; line-height: 20px; margin: 10px 0px; padding: 5px; text-rendering: optimizelegibility; transition: all 0.2s ease-in-out 0s;"&gt;
Example using JRadioButton&lt;/h4&gt;
&lt;pre class="java language-java" style="background: rgb(30, 42, 55); border-radius: 0.3em; color: #f8f8f2; font-family: Consolas, Monaco, &amp;quot;andale mono&amp;quot;, &amp;quot;ubuntu mono&amp;quot;, monospace; font-size: 11px; hyphens: none; line-height: 1.5; margin-bottom: 0.5em; margin-top: 0.5em; overflow-wrap: normal; overflow: auto; padding: 1em; tab-size: 4; text-shadow: rgba(0, 0, 0, 0.3) 0px 1px; word-break: normal;"&gt;&lt;code class=" language-java" style="background: 0px 0px; border-radius: 0px; font-family: Consolas, Monaco, &amp;quot;andale mono&amp;quot;, &amp;quot;ubuntu mono&amp;quot;, monospace; font-size: inherit; hyphens: none; line-height: 1.5; overflow-wrap: normal; padding: 0px; tab-size: 4; text-shadow: rgba(0, 0, 0, 0.3) 0px 1px; word-break: normal; word-spacing: normal;"&gt;&lt;span class="token keyword" style="color: #66d9ef;"&gt;import&lt;/span&gt; javax&lt;span class="token punctuation"&gt;.&lt;/span&gt;swing&lt;span class="token punctuation"&gt;.&lt;/span&gt;*&lt;span class="token punctuation"&gt;;&lt;/span&gt;
&lt;span class="token keyword" style="color: #66d9ef;"&gt;import&lt;/span&gt; java&lt;span class="token punctuation"&gt;.&lt;/span&gt;awt&lt;span class="token punctuation"&gt;.&lt;/span&gt;event&lt;span class="token punctuation"&gt;.&lt;/span&gt;*&lt;span class="token punctuation"&gt;;&lt;/span&gt;
&lt;span class="token keyword" style="color: #66d9ef;"&gt;import&lt;/span&gt; java&lt;span class="token punctuation"&gt;.&lt;/span&gt;awt&lt;span class="token punctuation"&gt;.&lt;/span&gt;*&lt;span class="token punctuation"&gt;;&lt;/span&gt;
&lt;span class="token keyword" style="color: #66d9ef;"&gt;public&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;class&lt;/span&gt; &lt;span class="token class-name"&gt;Test&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;extends&lt;/span&gt; &lt;span class="token class-name"&gt;JFrame&lt;/span&gt;
&lt;span class="token punctuation"&gt;{&lt;/span&gt;
 &lt;span class="token keyword" style="color: #66d9ef;"&gt;public&lt;/span&gt; &lt;span class="token function" style="color: #e6db74;"&gt;Test&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;
 &lt;span class="token punctuation"&gt;{&lt;/span&gt;
  JRadioButton jcb &lt;span class="token operator"&gt;=&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;new&lt;/span&gt; &lt;span class="token class-name"&gt;JRadioButton&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string" style="color: #a6e22e;"&gt;"A"&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt; &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//creating JRadioButton.&lt;/span&gt;
  &lt;span class="token function" style="color: #e6db74;"&gt;add&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;jcb&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;     &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//adding JRadioButton to frame.&lt;/span&gt;
  jcb &lt;span class="token operator"&gt;=&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;new&lt;/span&gt; &lt;span class="token class-name"&gt;JRadioButton&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string" style="color: #a6e22e;"&gt;"B"&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;   &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//creating JRadioButton.&lt;/span&gt;
  &lt;span class="token function" style="color: #e6db74;"&gt;add&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;jcb&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;     &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//adding JRadioButton to frame.&lt;/span&gt;
  jcb &lt;span class="token operator"&gt;=&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;new&lt;/span&gt; &lt;span class="token class-name"&gt;JRadioButton&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string" style="color: #a6e22e;"&gt;"C"&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;   &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//creating JRadioButton.&lt;/span&gt;
  &lt;span class="token function" style="color: #e6db74;"&gt;add&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;jcb&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;     &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//adding JRadioButton to frame.&lt;/span&gt;
  jcb &lt;span class="token operator"&gt;=&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;new&lt;/span&gt; &lt;span class="token class-name"&gt;JRadioButton&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string" style="color: #a6e22e;"&gt;"none"&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
  &lt;span class="token function" style="color: #e6db74;"&gt;add&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;jcb&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
  &lt;span class="token function" style="color: #e6db74;"&gt;setLayout&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token keyword" style="color: #66d9ef;"&gt;new&lt;/span&gt; &lt;span class="token class-name"&gt;FlowLayout&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
  &lt;span class="token function" style="color: #e6db74;"&gt;setDefaultCloseOperation&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;JFrame&lt;span class="token punctuation"&gt;.&lt;/span&gt;EXIT_ON_CLOSE&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
  &lt;span class="token function" style="color: #e6db74;"&gt;setSize&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token number" style="color: #ae81ff;"&gt;400&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt; &lt;span class="token number" style="color: #ae81ff;"&gt;400&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
  &lt;span class="token function" style="color: #e6db74;"&gt;setVisible&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token boolean" style="color: #ae81ff;"&gt;true&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
 &lt;span class="token punctuation"&gt;}&lt;/span&gt;
 &lt;span class="token keyword" style="color: #66d9ef;"&gt;public&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;static&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;void&lt;/span&gt; &lt;span class="token function" style="color: #e6db74;"&gt;main&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;String&lt;span class="token punctuation"&gt;[&lt;/span&gt;&lt;span class="token punctuation"&gt;]&lt;/span&gt; args&lt;span class="token punctuation"&gt;)&lt;/span&gt;
 &lt;span class="token punctuation"&gt;{&lt;/span&gt;
  &lt;span class="token keyword" style="color: #66d9ef;"&gt;new&lt;/span&gt; &lt;span class="token class-name"&gt;Test&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
 &lt;span class="token punctuation"&gt;}&lt;/span&gt;
&lt;span class="token punctuation"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div class="center" style="background-color: white; font-family: Arial, sans-serif; font-size: 15px; margin-bottom: 10px; text-align: center !important;"&gt;
&lt;img alt="jradiobutton example" src="https://www.studytonight.com/java/images/jradiobutton-example.jpg" style="border: 0px; height: auto; max-width: 100%; vertical-align: middle;" /&gt;&lt;/div&gt;
&lt;hr style="background-color: white; border-bottom-color: rgb(255, 255, 255); border-bottom-style: solid; border-image: initial; border-left: 0px; border-right: 0px; border-top-color: rgb(238, 238, 238); border-top-style: solid; font-family: Arial, sans-serif; font-size: 15px; margin: 20px 0px 20px -20px;" /&gt;
&lt;h4 style="background-color: white; box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px; color: #bf360c; font-family: roboto, sans-serif; font-size: 17.5px; line-height: 20px; margin: 10px 0px; padding: 5px; text-rendering: optimizelegibility; transition: all 0.2s ease-in-out 0s;"&gt;
JComboBox&lt;/h4&gt;
&lt;div style="background-color: white; font-family: Arial, sans-serif; font-size: 15px; margin-bottom: 10px;"&gt;
Combo box is a combination of text fields and drop-down list.&lt;b&gt;JComboBox&lt;/b&gt;&amp;nbsp;component is used to create a combo box in Swing. Following is the constructor for JComboBox,&lt;/div&gt;
&lt;pre class="java language-java" style="background: rgb(30, 42, 55); border-radius: 0.3em; color: #f8f8f2; font-family: Consolas, Monaco, &amp;quot;andale mono&amp;quot;, &amp;quot;ubuntu mono&amp;quot;, monospace; font-size: 11px; hyphens: none; line-height: 1.5; margin-bottom: 0.5em; margin-top: 0.5em; overflow-wrap: normal; overflow: auto; padding: 1em; tab-size: 4; text-shadow: rgba(0, 0, 0, 0.3) 0px 1px; word-break: normal;"&gt;&lt;code class=" language-java" style="background: 0px 0px; border-radius: 0px; font-family: Consolas, Monaco, &amp;quot;andale mono&amp;quot;, &amp;quot;ubuntu mono&amp;quot;, monospace; font-size: inherit; hyphens: none; line-height: 1.5; overflow-wrap: normal; padding: 0px; tab-size: 4; text-shadow: rgba(0, 0, 0, 0.3) 0px 1px; word-break: normal; word-spacing: normal;"&gt;&lt;span class="token function" style="color: #e6db74;"&gt;JComboBox&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;String arr&lt;span class="token punctuation"&gt;[&lt;/span&gt;&lt;span class="token punctuation"&gt;]&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h4 style="background-color: white; box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px; color: #bf360c; font-family: roboto, sans-serif; font-size: 17.5px; line-height: 20px; margin: 10px 0px; padding: 5px; text-rendering: optimizelegibility; transition: all 0.2s ease-in-out 0s;"&gt;
Example using JComboBox&lt;/h4&gt;
&lt;pre class="java language-java" style="background: rgb(30, 42, 55); border-radius: 0.3em; color: #f8f8f2; font-family: Consolas, Monaco, &amp;quot;andale mono&amp;quot;, &amp;quot;ubuntu mono&amp;quot;, monospace; font-size: 11px; hyphens: none; line-height: 1.5; margin-bottom: 0.5em; margin-top: 0.5em; overflow-wrap: normal; overflow: auto; padding: 1em; tab-size: 4; text-shadow: rgba(0, 0, 0, 0.3) 0px 1px; word-break: normal;"&gt;&lt;code class=" language-java" style="background: 0px 0px; border-radius: 0px; font-family: Consolas, Monaco, &amp;quot;andale mono&amp;quot;, &amp;quot;ubuntu mono&amp;quot;, monospace; font-size: inherit; hyphens: none; line-height: 1.5; overflow-wrap: normal; padding: 0px; tab-size: 4; text-shadow: rgba(0, 0, 0, 0.3) 0px 1px; word-break: normal; word-spacing: normal;"&gt;&lt;span class="token keyword" style="color: #66d9ef;"&gt;import&lt;/span&gt; javax&lt;span class="token punctuation"&gt;.&lt;/span&gt;swing&lt;span class="token punctuation"&gt;.&lt;/span&gt;*&lt;span class="token punctuation"&gt;;&lt;/span&gt;
&lt;span class="token keyword" style="color: #66d9ef;"&gt;import&lt;/span&gt; java&lt;span class="token punctuation"&gt;.&lt;/span&gt;awt&lt;span class="token punctuation"&gt;.&lt;/span&gt;event&lt;span class="token punctuation"&gt;.&lt;/span&gt;*&lt;span class="token punctuation"&gt;;&lt;/span&gt;
&lt;span class="token keyword" style="color: #66d9ef;"&gt;import&lt;/span&gt; java&lt;span class="token punctuation"&gt;.&lt;/span&gt;awt&lt;span class="token punctuation"&gt;.&lt;/span&gt;*&lt;span class="token punctuation"&gt;;&lt;/span&gt;
&lt;span class="token keyword" style="color: #66d9ef;"&gt;public&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;class&lt;/span&gt; &lt;span class="token class-name"&gt;Test&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;extends&lt;/span&gt; &lt;span class="token class-name"&gt;JFrame&lt;/span&gt;
&lt;span class="token punctuation"&gt;{&lt;/span&gt;
 String name&lt;span class="token punctuation"&gt;[&lt;/span&gt;&lt;span class="token punctuation"&gt;]&lt;/span&gt; &lt;span class="token operator"&gt;=&lt;/span&gt; &lt;span class="token punctuation"&gt;{&lt;/span&gt;&lt;span class="token string" style="color: #a6e22e;"&gt;"Abhi"&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;&lt;span class="token string" style="color: #a6e22e;"&gt;"Adam"&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;&lt;span class="token string" style="color: #a6e22e;"&gt;"Alex"&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;&lt;span class="token string" style="color: #a6e22e;"&gt;"Ashkay"&lt;/span&gt;&lt;span class="token punctuation"&gt;}&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;  &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//list of name.&lt;/span&gt;
 &lt;span class="token keyword" style="color: #66d9ef;"&gt;public&lt;/span&gt; &lt;span class="token function" style="color: #e6db74;"&gt;Test&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;
 &lt;span class="token punctuation"&gt;{&lt;/span&gt;
  JComboBox jc &lt;span class="token operator"&gt;=&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;new&lt;/span&gt; &lt;span class="token class-name"&gt;JComboBox&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;name&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt; &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//initialzing combo box with list of name.&lt;/span&gt;
  &lt;span class="token function" style="color: #e6db74;"&gt;add&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;jc&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;    &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//adding JComboBox to frame.&lt;/span&gt;
  &lt;span class="token function" style="color: #e6db74;"&gt;setLayout&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token keyword" style="color: #66d9ef;"&gt;new&lt;/span&gt; &lt;span class="token class-name"&gt;FlowLayout&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
  &lt;span class="token function" style="color: #e6db74;"&gt;setDefaultCloseOperation&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;JFrame&lt;span class="token punctuation"&gt;.&lt;/span&gt;EXIT_ON_CLOSE&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
  &lt;span class="token function" style="color: #e6db74;"&gt;setSize&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token number" style="color: #ae81ff;"&gt;400&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt; &lt;span class="token number" style="color: #ae81ff;"&gt;400&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
  &lt;span class="token function" style="color: #e6db74;"&gt;setVisible&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token boolean" style="color: #ae81ff;"&gt;true&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
 &lt;span class="token punctuation"&gt;}&lt;/span&gt;
 &lt;span class="token keyword" style="color: #66d9ef;"&gt;public&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;static&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;void&lt;/span&gt; &lt;span class="token function" style="color: #e6db74;"&gt;main&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;String&lt;span class="token punctuation"&gt;[&lt;/span&gt;&lt;span class="token punctuation"&gt;]&lt;/span&gt; args&lt;span class="token punctuation"&gt;)&lt;/span&gt;
 &lt;span class="token punctuation"&gt;{&lt;/span&gt;
  &lt;span class="token keyword" style="color: #66d9ef;"&gt;new&lt;/span&gt; &lt;span class="token class-name"&gt;Test&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
 &lt;span class="token punctuation"&gt;}&lt;/span&gt;
&lt;span class="token punctuation"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div class="center" style="background-color: white; font-family: Arial, sans-serif; font-size: 15px; margin-bottom: 10px; text-align: center !important;"&gt;
&lt;img alt="jcombobox example" src="https://www.studytonight.com/java/images/jcombobox-example.jpg" style="border: 0px; height: auto; max-width: 100%; vertical-align: middle;" /&gt;&lt;/div&gt;
&lt;hr style="background-color: white; border-bottom-color: rgb(255, 255, 255); border-bottom-style: solid; border-image: initial; border-left: 0px; border-right: 0px; border-top-color: rgb(238, 238, 238); border-top-style: solid; font-family: Arial, sans-serif; font-size: 15px; margin: 20px 0px 20px -20px;" /&gt;
&lt;h4 style="background-color: white; box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px; color: #bf360c; font-family: roboto, sans-serif; font-size: 17.5px; line-height: 20px; margin: 10px 0px; padding: 5px; text-rendering: optimizelegibility; transition: all 0.2s ease-in-out 0s;"&gt;
A program to change background color of a frame (Using Action Event)&lt;/h4&gt;
&lt;pre class="java language-java" style="background: rgb(30, 42, 55); border-radius: 0.3em; color: #f8f8f2; font-family: Consolas, Monaco, &amp;quot;andale mono&amp;quot;, &amp;quot;ubuntu mono&amp;quot;, monospace; font-size: 11px; hyphens: none; line-height: 1.5; margin-bottom: 0.5em; margin-top: 0.5em; overflow-wrap: normal; overflow: auto; padding: 1em; tab-size: 4; text-shadow: rgba(0, 0, 0, 0.3) 0px 1px; word-break: normal;"&gt;&lt;code class=" language-java" style="background: 0px 0px; border-radius: 0px; font-family: Consolas, Monaco, &amp;quot;andale mono&amp;quot;, &amp;quot;ubuntu mono&amp;quot;, monospace; font-size: inherit; hyphens: none; line-height: 1.5; overflow-wrap: normal; padding: 0px; tab-size: 4; text-shadow: rgba(0, 0, 0, 0.3) 0px 1px; word-break: normal; word-spacing: normal;"&gt;&lt;span class="token keyword" style="color: #66d9ef;"&gt;import&lt;/span&gt; java&lt;span class="token punctuation"&gt;.&lt;/span&gt;awt&lt;span class="token punctuation"&gt;.&lt;/span&gt;*&lt;span class="token punctuation"&gt;;&lt;/span&gt;  &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//importing awt package&lt;/span&gt;
&lt;span class="token keyword" style="color: #66d9ef;"&gt;import&lt;/span&gt; javax&lt;span class="token punctuation"&gt;.&lt;/span&gt;swing&lt;span class="token punctuation"&gt;.&lt;/span&gt;*&lt;span class="token punctuation"&gt;;&lt;/span&gt;  &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//importing swing package&lt;/span&gt;
&lt;span class="token keyword" style="color: #66d9ef;"&gt;import&lt;/span&gt; java&lt;span class="token punctuation"&gt;.&lt;/span&gt;awt&lt;span class="token punctuation"&gt;.&lt;/span&gt;event&lt;span class="token punctuation"&gt;.&lt;/span&gt;*&lt;span class="token punctuation"&gt;;&lt;/span&gt;  &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//importing event package&lt;/span&gt;

&lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//For an event to occur upon clicking the button, ActionListener interface should be implemented&lt;/span&gt;
&lt;span class="token keyword" style="color: #66d9ef;"&gt;class&lt;/span&gt; &lt;span class="token class-name"&gt;StColor&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;extends&lt;/span&gt; &lt;span class="token class-name"&gt;JFrame&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;implements&lt;/span&gt; &lt;span class="token class-name"&gt;ActionListener&lt;/span&gt;&lt;span class="token punctuation"&gt;{&lt;/span&gt;

JFrame frame&lt;span class="token punctuation"&gt;;&lt;/span&gt;
JPanel panel&lt;span class="token punctuation"&gt;;&lt;/span&gt;
JButton b1&lt;span class="token punctuation"&gt;,&lt;/span&gt;b2&lt;span class="token punctuation"&gt;,&lt;/span&gt;b3&lt;span class="token punctuation"&gt;,&lt;/span&gt;b4&lt;span class="token punctuation"&gt;,&lt;/span&gt;b5&lt;span class="token punctuation"&gt;;&lt;/span&gt;

&lt;span class="token function" style="color: #e6db74;"&gt;StColor&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;{&lt;/span&gt;

   frame &lt;span class="token operator"&gt;=&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;new&lt;/span&gt; &lt;span class="token class-name"&gt;JFrame&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string" style="color: #a6e22e;"&gt;"COLORS"&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
   frame&lt;span class="token punctuation"&gt;.&lt;/span&gt;&lt;span class="token function" style="color: #e6db74;"&gt;setDefaultCloseOperation&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;JFrame&lt;span class="token punctuation"&gt;.&lt;/span&gt;EXIT_ON_CLOSE&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;

   panel &lt;span class="token operator"&gt;=&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;new&lt;/span&gt; &lt;span class="token class-name"&gt;JPanel&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;  &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//Creating a panel which is a container and will hold all the buttons&lt;/span&gt;
   panel&lt;span class="token punctuation"&gt;.&lt;/span&gt;&lt;span class="token function" style="color: #e6db74;"&gt;setSize&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token number" style="color: #ae81ff;"&gt;100&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt; &lt;span class="token number" style="color: #ae81ff;"&gt;50&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;

   b1 &lt;span class="token operator"&gt;=&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;new&lt;/span&gt; &lt;span class="token class-name"&gt;JButton&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string" style="color: #a6e22e;"&gt;"BLUE"&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;  &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//Creating a button named BLUE&lt;/span&gt;
   b1&lt;span class="token punctuation"&gt;.&lt;/span&gt;&lt;span class="token function" style="color: #e6db74;"&gt;addActionListener&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token keyword" style="color: #66d9ef;"&gt;this&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;  &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//Registering the button with the listener&lt;/span&gt;

   b2 &lt;span class="token operator"&gt;=&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;new&lt;/span&gt; &lt;span class="token class-name"&gt;JButton&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string" style="color: #a6e22e;"&gt;"RED"&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;  &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//Creating a button named RED&lt;/span&gt;
   b2&lt;span class="token punctuation"&gt;.&lt;/span&gt;&lt;span class="token function" style="color: #e6db74;"&gt;addActionListener&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token keyword" style="color: #66d9ef;"&gt;this&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;  &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//Registering the button with the listener&lt;/span&gt;

   b3 &lt;span class="token operator"&gt;=&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;new&lt;/span&gt; &lt;span class="token class-name"&gt;JButton&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string" style="color: #a6e22e;"&gt;"CYAN"&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;&lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//Creating a button named CYAN&lt;/span&gt;
   b3&lt;span class="token punctuation"&gt;.&lt;/span&gt;&lt;span class="token function" style="color: #e6db74;"&gt;addActionListener&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token keyword" style="color: #66d9ef;"&gt;this&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;&lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//Registering the button with the listener&lt;/span&gt;

   b4 &lt;span class="token operator"&gt;=&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;new&lt;/span&gt; &lt;span class="token class-name"&gt;JButton&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string" style="color: #a6e22e;"&gt;"PINK"&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;  &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//Creating a button named PINK&lt;/span&gt;
   b4&lt;span class="token punctuation"&gt;.&lt;/span&gt;&lt;span class="token function" style="color: #e6db74;"&gt;addActionListener&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token keyword" style="color: #66d9ef;"&gt;this&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;  &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//Registering the button with the listener&lt;/span&gt;

   b5 &lt;span class="token operator"&gt;=&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;new&lt;/span&gt; &lt;span class="token class-name"&gt;JButton&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string" style="color: #a6e22e;"&gt;"MAGENTA"&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;  &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//Creating a button named MAGENTA&lt;/span&gt;
   b5&lt;span class="token punctuation"&gt;.&lt;/span&gt;&lt;span class="token function" style="color: #e6db74;"&gt;addActionListener&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token keyword" style="color: #66d9ef;"&gt;this&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;  &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//Registering the button with the listener&lt;/span&gt;

   &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//Adding buttons to the Panel&lt;/span&gt;
   panel&lt;span class="token punctuation"&gt;.&lt;/span&gt;&lt;span class="token function" style="color: #e6db74;"&gt;add&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;b1&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
   panel&lt;span class="token punctuation"&gt;.&lt;/span&gt;&lt;span class="token function" style="color: #e6db74;"&gt;add&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;b2&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
   panel&lt;span class="token punctuation"&gt;.&lt;/span&gt;&lt;span class="token function" style="color: #e6db74;"&gt;add&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;b3&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
   panel&lt;span class="token punctuation"&gt;.&lt;/span&gt;&lt;span class="token function" style="color: #e6db74;"&gt;add&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;b4&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
   panel&lt;span class="token punctuation"&gt;.&lt;/span&gt;&lt;span class="token function" style="color: #e6db74;"&gt;add&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;b5&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;

   frame&lt;span class="token punctuation"&gt;.&lt;/span&gt;&lt;span class="token function" style="color: #e6db74;"&gt;getContentPane&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;.&lt;/span&gt;&lt;span class="token function" style="color: #e6db74;"&gt;add&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;panel&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;  &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//adding panel to the frame&lt;/span&gt;
   frame&lt;span class="token punctuation"&gt;.&lt;/span&gt;&lt;span class="token function" style="color: #e6db74;"&gt;setSize&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token number" style="color: #ae81ff;"&gt;500&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt;&lt;span class="token number" style="color: #ae81ff;"&gt;300&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
   frame&lt;span class="token punctuation"&gt;.&lt;/span&gt;&lt;span class="token function" style="color: #e6db74;"&gt;setVisible&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token boolean" style="color: #ae81ff;"&gt;true&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
   frame&lt;span class="token punctuation"&gt;.&lt;/span&gt;&lt;span class="token function" style="color: #e6db74;"&gt;setLayout&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token keyword" style="color: #66d9ef;"&gt;new&lt;/span&gt; &lt;span class="token class-name"&gt;FlowLayout&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;

&lt;span class="token punctuation"&gt;}&lt;/span&gt;
&lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//The below method is called whenever a button is clicked&lt;/span&gt;
    &lt;span class="token annotation punctuation"&gt;@Override&lt;/span&gt;
    &lt;span class="token keyword" style="color: #66d9ef;"&gt;public&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;void&lt;/span&gt; &lt;span class="token function" style="color: #e6db74;"&gt;actionPerformed&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;ActionEvent e&lt;span class="token punctuation"&gt;)&lt;/span&gt; &lt;span class="token punctuation"&gt;{&lt;/span&gt;

        &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//This method returns an object of the button on which the Event-&lt;/span&gt;
        Pressing of button initially occurred
        Object see &lt;span class="token operator"&gt;=&lt;/span&gt; e&lt;span class="token punctuation"&gt;.&lt;/span&gt;&lt;span class="token function" style="color: #e6db74;"&gt;getSource&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;

        &lt;span class="token keyword" style="color: #66d9ef;"&gt;if&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;see &lt;span class="token operator"&gt;==&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;b1&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;{&lt;/span&gt;  &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//Checking if the object returned is of button1&lt;/span&gt;
        frame&lt;span class="token punctuation"&gt;.&lt;/span&gt;&lt;span class="token function" style="color: #e6db74;"&gt;getContentPane&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;.&lt;/span&gt;&lt;span class="token function" style="color: #e6db74;"&gt;setBackground&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;java&lt;span class="token punctuation"&gt;.&lt;/span&gt;awt&lt;span class="token punctuation"&gt;.&lt;/span&gt;Color&lt;span class="token punctuation"&gt;.&lt;/span&gt;blue&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;  &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//changing the panel color to blue&lt;/span&gt;
        &lt;span class="token punctuation"&gt;}&lt;/span&gt;
        &lt;span class="token keyword" style="color: #66d9ef;"&gt;if&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;see &lt;span class="token operator"&gt;==&lt;/span&gt; b2&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;{&lt;/span&gt;  &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//Checking if the object returned is of button2&lt;/span&gt;
            frame&lt;span class="token punctuation"&gt;.&lt;/span&gt;&lt;span class="token function" style="color: #e6db74;"&gt;getContentPane&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;.&lt;/span&gt;&lt;span class="token function" style="color: #e6db74;"&gt;setBackground&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;java&lt;span class="token punctuation"&gt;.&lt;/span&gt;awt&lt;span class="token punctuation"&gt;.&lt;/span&gt;Color&lt;span class="token punctuation"&gt;.&lt;/span&gt;red&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;  &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//changing the panel color to red&lt;/span&gt;
        &lt;span class="token punctuation"&gt;}&lt;/span&gt;
        &lt;span class="token keyword" style="color: #66d9ef;"&gt;if&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;see &lt;span class="token operator"&gt;==&lt;/span&gt; b3&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;{&lt;/span&gt;  &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//Checking if the object returned is of button3&lt;/span&gt;
        frame&lt;span class="token punctuation"&gt;.&lt;/span&gt;&lt;span class="token function" style="color: #e6db74;"&gt;getContentPane&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;.&lt;/span&gt;&lt;span class="token function" style="color: #e6db74;"&gt;setBackground&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;java&lt;span class="token punctuation"&gt;.&lt;/span&gt;awt&lt;span class="token punctuation"&gt;.&lt;/span&gt;Color&lt;span class="token punctuation"&gt;.&lt;/span&gt;cyan&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;&lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//changing the panel color to cyan&lt;/span&gt;
        &lt;span class="token punctuation"&gt;}&lt;/span&gt;
        &lt;span class="token keyword" style="color: #66d9ef;"&gt;if&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;see &lt;span class="token operator"&gt;==&lt;/span&gt; b4&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;{&lt;/span&gt;  &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//Checking if the object returned is of button4&lt;/span&gt;
            frame&lt;span class="token punctuation"&gt;.&lt;/span&gt;&lt;span class="token function" style="color: #e6db74;"&gt;getContentPane&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;.&lt;/span&gt;&lt;span class="token function" style="color: #e6db74;"&gt;setBackground&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;java&lt;span class="token punctuation"&gt;.&lt;/span&gt;awt&lt;span class="token punctuation"&gt;.&lt;/span&gt;Color&lt;span class="token punctuation"&gt;.&lt;/span&gt;pink&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;  &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//changing the panel color to pink&lt;/span&gt;
        &lt;span class="token punctuation"&gt;}&lt;/span&gt;
        &lt;span class="token keyword" style="color: #66d9ef;"&gt;if&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;see &lt;span class="token operator"&gt;==&lt;/span&gt; b5&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;{&lt;/span&gt;  &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//Checking if the object returned is of button5&lt;/span&gt;
        frame&lt;span class="token punctuation"&gt;.&lt;/span&gt;&lt;span class="token function" style="color: #e6db74;"&gt;getContentPane&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;.&lt;/span&gt;&lt;span class="token function" style="color: #e6db74;"&gt;setBackground&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;java&lt;span class="token punctuation"&gt;.&lt;/span&gt;awt&lt;span class="token punctuation"&gt;.&lt;/span&gt;Color&lt;span class="token punctuation"&gt;.&lt;/span&gt;magenta&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;  &lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;//changing the panel color to magenta&lt;/span&gt;
        &lt;span class="token punctuation"&gt;}&lt;/span&gt;
    &lt;span class="token punctuation"&gt;}&lt;/span&gt;
&lt;span class="token punctuation"&gt;}&lt;/span&gt;

&lt;span class="token keyword" style="color: #66d9ef;"&gt;class&lt;/span&gt; &lt;span class="token class-name"&gt;Test&lt;/span&gt; &lt;span class="token punctuation"&gt;{&lt;/span&gt;
    &lt;span class="token keyword" style="color: #66d9ef;"&gt;public&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;static&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;void&lt;/span&gt; &lt;span class="token function" style="color: #e6db74;"&gt;main&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;String&lt;span class="token punctuation"&gt;[&lt;/span&gt;&lt;span class="token punctuation"&gt;]&lt;/span&gt; args&lt;span class="token punctuation"&gt;)&lt;/span&gt; &lt;span class="token punctuation"&gt;{&lt;/span&gt;
        StColor o &lt;span class="token operator"&gt;=&lt;/span&gt; &lt;span class="token keyword" style="color: #66d9ef;"&gt;new&lt;/span&gt; &lt;span class="token class-name"&gt;StColor&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
    &lt;span class="token punctuation"&gt;}&lt;/span&gt;
&lt;span class="token punctuation"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 style="background-color: white; font-family: roboto, sans-serif; font-size: 24.5px; line-height: 40px; margin: 5px 0px; text-rendering: optimizelegibility;"&gt;
Ouput:&lt;/h3&gt;
&lt;div class="center" style="background-color: white; font-family: Arial, sans-serif; font-size: 15px; margin-bottom: 10px; text-align: center !important;"&gt;
&lt;img alt="Background Color of a frame" src="https://www.studytonight.com/java/images/background-color.png" style="border: 0px; height: auto; max-width: 100%; vertical-align: middle;" /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</description><link>https://tweetprogrammer.blogspot.com/2019/06/frame-construction-2-java-swing-core.html</link><author>noreply@blogger.com (Mohammad Saquib Khan)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8yk-kBv_3tXgXD5uRVxR70tSySpyVADSsoUatvJYWyztrgAJ3fM1HU6eaGj0fHWME1XzRnP7Mfsw9fVLwJ8-U07H24zmrtUB0pWnJnADNlJFQQb5xk7s_4iXJ-bft2XLBccnl3RKESPju/s72-c/Logo-1560585542706+%25282%2529.png" width="72"/><thr:total>0</thr:total><georss:featurename>UPSIDC Industrial Area, Naini, Prayagraj, Uttar Pradesh 211009, India</georss:featurename><georss:point>25.3431443 81.910167099999967</georss:point><georss:box>-0.17889020000000144 40.601573099999968 50.865178799999995 123.21876109999997</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7867323827570382405.post-7833189736861548727</guid><pubDate>Mon, 27 May 2019 20:52:00 +0000</pubDate><atom:updated>2019-06-15T07:27:06.420-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Applet</category><category domain="http://www.blogger.com/atom/ns#">awt</category><category domain="http://www.blogger.com/atom/ns#">Frame construction</category><category domain="http://www.blogger.com/atom/ns#">java</category><title>Frame Construction-1 || Java Awt || Core Graphics ||</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;h2 style="text-align: left;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;"&gt;Creating a frame window in java Awt&lt;/span&gt;&lt;/h2&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJ_L5-1yHrH4Be1MQCitDXPVPH5Q9TvqYaOn9G5i5L7e9uyMNXFe9LFAFx0GXBv5fPX0All94D3MzmXGMa2bBYjQbSKTM4-WX4hVa76t13JJwvMd-Fk64NWX2Y4Rg467Qhr3zDWaG46O73/s1600/Logo-1560587299460.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em; text-align: center;"&gt;&lt;img border="0" data-original-height="1000" data-original-width="1000" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJ_L5-1yHrH4Be1MQCitDXPVPH5Q9TvqYaOn9G5i5L7e9uyMNXFe9LFAFx0GXBv5fPX0All94D3MzmXGMa2bBYjQbSKTM4-WX4hVa76t13JJwvMd-Fk64NWX2Y4Rg467Qhr3zDWaG46O73/s320/Logo-1560587299460.png" width="320" /&gt;&lt;b style="text-align: left;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-weight: normal;"&gt;Creating a new frame window from within an applet is actually quite easy. First, create a subclass of Frame. Next, override any of the standard applet methods, such as init( ), start( ),and stop( ), to show or hide the frame as needed. Finally, implement the windowClosing( )&amp;nbsp;method of the WindowListener interface, calling setVisible(false) when the window is closed.&amp;nbsp;Once you have defined a Frame subclass, you can create an object of that class. This causes&amp;nbsp;a frame window to come into existence, but it will not be initially visible. You make it visible&amp;nbsp;by calling setVisible( ). When created, the window is given a default height and width. You&amp;nbsp;can set the size of the window explicitly by calling the setSize( ) method.The following applet creates a subclass of Frame called SampleFrame. A window of this&amp;nbsp;subclass is instantiated within the init( ) method of AppletFrame. Notice that SampleFrame&amp;nbsp;calls Frame’s constructor. This causes a standard frame window to be created with the titlepassed in title. This example overrides the applet’s start( ) and stop( ) methods so that they&amp;nbsp;show and hide the child window, respectively. This causes the window to be removed&amp;nbsp;automatically when you terminate the applet, when you close the window, or, if using a&amp;nbsp;browser, when you move to another page. It also causes the child window to be shown whenthe browser returns to the applet&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b style="font-family: inherit;"&gt;&lt;u&gt;Source Code:&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: x-small;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style="font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;"&gt;&lt;b&gt;import java.awt.*;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;"&gt;&lt;b&gt;import java.awt.event.*;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;"&gt;&lt;b&gt;import java.applet.*;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;"&gt;&lt;b&gt;/*&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;"&gt;&lt;b&gt;&amp;lt;applet code="AppletFrame" width=300 height=50&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;"&gt;&lt;b&gt;&amp;lt;/applet&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;"&gt;&lt;b&gt;*/&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;"&gt;&lt;b&gt;// Create a subclass of Frame.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;"&gt;&lt;b&gt;class SampleFrame extends Frame {&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;"&gt;&lt;b&gt;SampleFrame(String title) {&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;"&gt;&lt;b&gt;super(title);&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;"&gt;&lt;b&gt;// create an object to handle window events&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;"&gt;&lt;b&gt;MyWindowAdapter adapter = new MyWindowAdapter(this);&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;"&gt;&lt;b&gt;// register it to receive those events&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;"&gt;&lt;b&gt;addWindowListener(adapter);&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;"&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;"&gt;&lt;b&gt;public void paint(Graphics g) {&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;"&gt;&lt;b&gt;g.drawString("This is in frame window", 10, 40);&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;"&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;"&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;"&gt;&lt;b&gt;class MyWindowAdapter extends WindowAdapter {&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;"&gt;&lt;b&gt;SampleFrame sampleFrame;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;"&gt;&lt;b&gt;public MyWindowAdapter(SampleFrame sampleFrame) {&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;"&gt;&lt;b&gt;this.sampleFrame = sampleFrame;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;"&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;"&gt;&lt;b&gt;public void windowClosing(WindowEvent we) {&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;"&gt;&lt;b&gt;sampleFrame.setVisible(false);&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;"&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;"&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;"&gt;&lt;b&gt;// Create frame window.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: &amp;quot;georgia&amp;quot; , &amp;quot;times new roman&amp;quot; , serif; font-size: xx-small;"&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;"&gt;
public class AppletFrame extends Applet {&lt;br /&gt;
Frame f;&lt;br /&gt;
public void init() {&lt;br /&gt;
f = new SampleFrame("A Frame Window");&lt;br /&gt;
f.setSize(250, 250);&lt;br /&gt;
f.setVisible(true);}&lt;br /&gt;
public void start() {&lt;br /&gt;
f.setVisible(true);}&lt;br /&gt;
public void stop() {&lt;br /&gt;
f.setVisible(false);}&lt;br /&gt;
public void paint(Graphics g) {&lt;br /&gt;
g.drawString("This is in applet window", 10, 20);&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style="font-family: &amp;quot;georgia&amp;quot; , &amp;quot;times new roman&amp;quot; , serif; font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: &amp;quot;georgia&amp;quot; , &amp;quot;times new roman&amp;quot; , serif; font-size: x-small;"&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</description><link>https://tweetprogrammer.blogspot.com/2019/05/creating-frame-window-in-java-applet.html</link><author>noreply@blogger.com (Mohammad Saquib Khan)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJ_L5-1yHrH4Be1MQCitDXPVPH5Q9TvqYaOn9G5i5L7e9uyMNXFe9LFAFx0GXBv5fPX0All94D3MzmXGMa2bBYjQbSKTM4-WX4hVa76t13JJwvMd-Fk64NWX2Y4Rg467Qhr3zDWaG46O73/s72-c/Logo-1560587299460.png" width="72"/><thr:total>0</thr:total><georss:featurename>UPSIDC Industrial Area, Naini, Prayagraj, Uttar Pradesh 211009, India</georss:featurename><georss:point>25.3431443 81.910167099999967</georss:point><georss:box>-5.4052657000000011 40.601573099999968 56.0915543 123.21876109999997</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7867323827570382405.post-2463164828439005881</guid><pubDate>Sat, 25 May 2019 04:32:00 +0000</pubDate><atom:updated>2019-05-24T21:34:36.353-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Constructor</category><category domain="http://www.blogger.com/atom/ns#">difference</category><category domain="http://www.blogger.com/atom/ns#">java</category><title>Constructor in Java</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;b&gt;Constructor in Java: A complete study.&lt;/b&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinIU4L9mueFBycxAmy-67qJ-zwr3sh0CYn6-IhIa90qte34s3d2kj9d7L23Oyyd1ons7-LmUxJ1hKi2WRXJdF0mBEoeoX4Gm22eL115BB1dmL-nkoptCv6mEtGwWK1Ugv3uY0tZkxofqMT/s1600/Logo-1558758020058.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;img border="0" data-original-height="1000" data-original-width="1000" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinIU4L9mueFBycxAmy-67qJ-zwr3sh0CYn6-IhIa90qte34s3d2kj9d7L23Oyyd1ons7-LmUxJ1hKi2WRXJdF0mBEoeoX4Gm22eL115BB1dmL-nkoptCv6mEtGwWK1Ugv3uY0tZkxofqMT/s320/Logo-1558758020058.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="background-color: white; box-sizing: border-box; color: #222426; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 17px; margin-bottom: 26px; padding: 0px;"&gt;
&lt;br /&gt;
Constructor is a block of code that initializes the newly created object. A constructor resembles an instance method in java but it’s not a method as it doesn’t have a return type. In short constructor and method are different(More on this at the end of this guide). People often refer constructor as special type of method in Java.&lt;/div&gt;
&lt;div style="background-color: white; box-sizing: border-box; color: #222426; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 17px; margin-bottom: 26px; padding: 0px;"&gt;
Constructor has same name as the class and looks like this in a java code.&lt;/div&gt;
&lt;pre class="prettyprint prettyprinted" style="background-color: #eeeeee; box-sizing: border-box; clear: both; color: #222426; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; overflow: auto; padding: 2px;"&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;public&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;class&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;MyClass&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;{&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
   &lt;/span&gt;&lt;span class="com" style="box-sizing: border-box; color: grey;"&gt;//This is the constructor&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
   &lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;MyClass&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;(){&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
   &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;}&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
   &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;..&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;blockquote style="background-color: white; border-left: 5px solid rgb(125, 194, 70); box-sizing: border-box; color: #222426; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 17px; margin: 20px 0px; padding-left: 1.5rem;"&gt;
&lt;div style="box-sizing: border-box; margin-bottom: 26px; padding: 0px;"&gt;
Note that the constructor name matches with the class name and it doesn’t have a return type.&lt;/div&gt;
&lt;/blockquote&gt;
&lt;h2 style="background-color: white; box-sizing: border-box; color: #444542; font-family: &amp;quot;PT Sans&amp;quot;, &amp;quot;Trebuchet MS&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 26px; line-height: 1.2; margin: 0px 0px 16px;"&gt;
How does a constructor work&lt;/h2&gt;
&lt;div style="background-color: white; box-sizing: border-box; color: #222426; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 17px; margin-bottom: 26px; padding: 0px;"&gt;
To understand the working of constructor, lets take an example. lets say we have a class&amp;nbsp;&lt;code style="background-color: #eeeeee; box-sizing: border-box; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;"&gt;MyClass&lt;/code&gt;.&lt;br /&gt;
When we create the object of&amp;nbsp;&lt;code style="background-color: #eeeeee; box-sizing: border-box; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;"&gt;MyClass&lt;/code&gt;&amp;nbsp;like this:&lt;/div&gt;
&lt;pre class="prettyprint prettyprinted" style="background-color: #eeeeee; box-sizing: border-box; clear: both; color: #222426; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; overflow: auto; padding: 2px;"&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;MyClass&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; obj &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;=&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;new&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;MyClass&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;()&lt;/span&gt;&lt;/pre&gt;
&lt;div style="background-color: white; box-sizing: border-box; color: #222426; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 17px; margin-bottom: 26px; padding: 0px;"&gt;
The&amp;nbsp;&lt;span style="box-sizing: border-box; font-weight: 700;"&gt;new keyword&lt;/span&gt;&amp;nbsp;here creates the object of class&amp;nbsp;&lt;code style="background-color: #eeeeee; box-sizing: border-box; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;"&gt;MyClass&lt;/code&gt;&amp;nbsp;and invokes the constructor to initialize this newly created object.&lt;/div&gt;
&lt;div style="background-color: white; box-sizing: border-box; color: #222426; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 17px; margin-bottom: 26px; padding: 0px;"&gt;
You may get a little lost here as I have not shown you any initialization example, lets have a look at the code below:&lt;/div&gt;
&lt;h3 style="background-color: white; box-sizing: border-box; color: #444542; font-family: &amp;quot;PT Sans&amp;quot;, &amp;quot;Trebuchet MS&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 22px; line-height: 1.2; margin: 0px 0px 16px;"&gt;
A simple constructor program in java&lt;/h3&gt;
&lt;div style="background-color: white; box-sizing: border-box; color: #222426; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 17px; margin-bottom: 26px; padding: 0px;"&gt;
Here we have created an object&amp;nbsp;&lt;code style="background-color: #eeeeee; box-sizing: border-box; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;"&gt;obj&lt;/code&gt;&amp;nbsp;of class&amp;nbsp;&lt;code style="background-color: #eeeeee; box-sizing: border-box; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;"&gt;Hello&lt;/code&gt;&amp;nbsp;and then we displayed the instance variable&amp;nbsp;&lt;code style="background-color: #eeeeee; box-sizing: border-box; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;"&gt;name&lt;/code&gt;&amp;nbsp;of the object. As you can see that the output is&amp;nbsp;&lt;code style="background-color: #eeeeee; box-sizing: border-box; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;"&gt;BeginnersBook.com&lt;/code&gt;&amp;nbsp;which is what we have passed to the&amp;nbsp;&lt;code style="background-color: #eeeeee; box-sizing: border-box; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;"&gt;name&lt;/code&gt;&amp;nbsp;during initialization in constructor. This shows that when we created the object&amp;nbsp;&lt;code style="background-color: #eeeeee; box-sizing: border-box; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;"&gt;obj&lt;/code&gt;&amp;nbsp;the constructor got invoked. In this example we have used&amp;nbsp;&lt;span style="box-sizing: border-box; font-weight: 700;"&gt;this keyword&lt;/span&gt;, which refers to the current object, object&amp;nbsp;&lt;code style="background-color: #eeeeee; box-sizing: border-box; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;"&gt;obj&lt;/code&gt;&amp;nbsp;in this example. We will cover this keyword in detail in the next tutorial.&lt;/div&gt;
&lt;pre class="prettyprint prettyprinted" style="background-color: #eeeeee; box-sizing: border-box; clear: both; color: #222426; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; overflow: auto; padding: 2px;"&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;public&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;class&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;Hello&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;{&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
   &lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;String&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; name&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
   &lt;/span&gt;&lt;span class="com" style="box-sizing: border-box; color: grey;"&gt;//Constructor&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
   &lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;Hello&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;(){&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
      &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;this&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;.&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;name &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;=&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="str" style="box-sizing: border-box; color: maroon;"&gt;"BeginnersBook.com"&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
   &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;}&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
   &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;public&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;static&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;void&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; main&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;(&lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;String&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;[]&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; args&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;)&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;{&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
      &lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;Hello&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; obj &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;=&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;new&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;Hello&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;();&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
      &lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;System&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;.&lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;out&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;.&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;println&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;(&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;obj&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;.&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;name&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;);&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
   &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;}&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;div style="background-color: white; box-sizing: border-box; color: #222426; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 17px; margin-bottom: 26px; padding: 0px;"&gt;
&lt;span style="box-sizing: border-box; font-weight: 700;"&gt;Output:&lt;/span&gt;&lt;/div&gt;
&lt;pre class="prettyprint prettyprinted" style="background-color: #eeeeee; box-sizing: border-box; clear: both; color: #222426; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; overflow: auto; padding: 2px;"&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;BeginnersBook&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;.&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;com&lt;/span&gt;&lt;/pre&gt;
&lt;div style="background-color: white; box-sizing: border-box; color: #222426; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 17px; margin-bottom: 26px; padding: 0px;"&gt;
&lt;img alt="new keyword invoked the constructor" class="aligncenter size-full wp-image-6633" height="300" sizes="(max-width: 500px) 100vw, 500px" src="https://beginnersbook.com/wp-content/uploads/2013/03/constructor_call_from_new_keyword.jpg" srcset="https://beginnersbook.com/wp-content/uploads/2013/03/constructor_call_from_new_keyword.jpg 500w, https://beginnersbook.com/wp-content/uploads/2013/03/constructor_call_from_new_keyword-300x180.jpg 300w" style="border: 0px; box-sizing: border-box; display: block; height: auto; margin: 0px auto 20px; max-width: 100%;" width="500" /&gt;&lt;/div&gt;
&lt;h2 style="background-color: white; box-sizing: border-box; color: #444542; font-family: &amp;quot;PT Sans&amp;quot;, &amp;quot;Trebuchet MS&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 26px; line-height: 1.2; margin: 0px 0px 16px;"&gt;
Types of Constructors&lt;/h2&gt;
&lt;div style="background-color: white; box-sizing: border-box; color: #222426; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 17px; margin-bottom: 26px; padding: 0px;"&gt;
There are three types of constructors: Default, No-arg constructor and Parameterized.&lt;br /&gt;
&lt;img alt="types of constructor" class="aligncenter size-full wp-image-6635" height="200" sizes="(max-width: 500px) 100vw, 500px" src="https://beginnersbook.com/wp-content/uploads/2013/03/types_of_constructor.jpg" srcset="https://beginnersbook.com/wp-content/uploads/2013/03/types_of_constructor.jpg 500w, https://beginnersbook.com/wp-content/uploads/2013/03/types_of_constructor-300x120.jpg 300w" style="border: 0px; box-sizing: border-box; display: block; height: auto; margin: 0px auto 20px; max-width: 100%;" width="500" /&gt;&lt;/div&gt;
&lt;h3 style="background-color: white; box-sizing: border-box; color: #444542; font-family: &amp;quot;PT Sans&amp;quot;, &amp;quot;Trebuchet MS&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 22px; line-height: 1.2; margin: 0px 0px 16px;"&gt;
Default constructor&lt;/h3&gt;
&lt;div style="background-color: white; box-sizing: border-box; color: #222426; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 17px; margin-bottom: 26px; padding: 0px;"&gt;
If you do not implement any constructor in your class, Java compiler inserts a&amp;nbsp;&lt;a href="https://beginnersbook.com/2014/01/default-constructor-java-example/" style="box-sizing: border-box; color: #7dc246; font-weight: bold !important; text-decoration-line: none; transition: all 0.1s ease-in-out 0s;"&gt;default constructor&lt;/a&gt;&amp;nbsp;into your code on your behalf. This constructor is known as default constructor. You would not find it in your source code(the java file) as it would be inserted into the code during compilation and exists in .class file. This process is shown in the diagram below:&lt;br /&gt;
&lt;img alt="default constructor" class="aligncenter size-full wp-image-6634" height="250" sizes="(max-width: 750px) 100vw, 750px" src="https://beginnersbook.com/wp-content/uploads/2013/03/default_constructor.jpg" srcset="https://beginnersbook.com/wp-content/uploads/2013/03/default_constructor.jpg 750w, https://beginnersbook.com/wp-content/uploads/2013/03/default_constructor-300x100.jpg 300w" style="border: 0px; box-sizing: border-box; display: block; height: auto; margin: 0px auto 20px; max-width: 100%;" width="750" /&gt;&lt;/div&gt;
&lt;blockquote style="background-color: white; border-left: 5px solid rgb(125, 194, 70); box-sizing: border-box; color: #222426; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 17px; margin: 20px 0px; padding-left: 1.5rem;"&gt;
&lt;div style="box-sizing: border-box; margin-bottom: 26px; padding: 0px;"&gt;
If you implement any constructor then you no longer receive a default constructor from Java compiler.&lt;/div&gt;
&lt;/blockquote&gt;
&lt;h3 style="background-color: white; box-sizing: border-box; color: #444542; font-family: &amp;quot;PT Sans&amp;quot;, &amp;quot;Trebuchet MS&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 22px; line-height: 1.2; margin: 0px 0px 16px;"&gt;
no-arg constructor:&lt;/h3&gt;
&lt;div style="background-color: white; box-sizing: border-box; color: #222426; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 17px; margin-bottom: 26px; padding: 0px;"&gt;
Constructor with no arguments is known as&amp;nbsp;&lt;span style="box-sizing: border-box; font-weight: 700;"&gt;no-arg constructor&lt;/span&gt;. The signature is same as default constructor, however body can have any code unlike default constructor where the body of the constructor is empty.&lt;/div&gt;
&lt;blockquote style="background-color: white; border-left: 5px solid rgb(125, 194, 70); box-sizing: border-box; color: #222426; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 17px; margin: 20px 0px; padding-left: 1.5rem;"&gt;
&lt;div style="box-sizing: border-box; margin-bottom: 26px; padding: 0px;"&gt;
Although you may see some people claim that that default and no-arg constructor is same but in fact they are not, even if you write&amp;nbsp;&lt;b style="box-sizing: border-box;"&gt;public Demo() { }&lt;/b&gt;in your class&amp;nbsp;&lt;code style="background-color: #eeeeee; box-sizing: border-box; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;"&gt;Demo&lt;/code&gt;&amp;nbsp;it cannot be called default constructor since you have written the code of it.&lt;/div&gt;
&lt;/blockquote&gt;
&lt;h4 style="background-color: white; box-sizing: border-box; color: #444542; font-family: &amp;quot;PT Sans&amp;quot;, &amp;quot;Trebuchet MS&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 20px; line-height: 1.2; margin: 0px 0px 16px;"&gt;
Example: no-arg constructor&lt;/h4&gt;
&lt;pre class="prettyprint prettyprinted" style="background-color: #eeeeee; box-sizing: border-box; clear: both; color: #222426; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; overflow: auto; padding: 2px;"&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;class&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;Demo&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;{&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
     &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;public&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;Demo&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;()&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
     &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;{&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
         &lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;System&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;.&lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;out&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;.&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;println&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;(&lt;/span&gt;&lt;span class="str" style="box-sizing: border-box; color: maroon;"&gt;"This is a no argument constructor"&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;);&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
     &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;}&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
     &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;public&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;static&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;void&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; main&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;(&lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;String&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; args&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;[])&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;{&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
      &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;new&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;Demo&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;();&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
     &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;}&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;div style="background-color: white; box-sizing: border-box; color: #222426; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 17px; margin-bottom: 26px; padding: 0px;"&gt;
Output:&lt;br /&gt;
This is a no argument constructor&lt;/div&gt;
&lt;h3 style="background-color: white; box-sizing: border-box; color: #444542; font-family: &amp;quot;PT Sans&amp;quot;, &amp;quot;Trebuchet MS&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 22px; line-height: 1.2; margin: 0px 0px 16px;"&gt;
Parameterized constructor&lt;/h3&gt;
&lt;div style="background-color: white; box-sizing: border-box; color: #222426; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 17px; margin-bottom: 26px; padding: 0px;"&gt;
Constructor with arguments(or you can say parameters) is known as&amp;nbsp;&lt;a href="https://beginnersbook.com/2014/01/parameterized-constructor-in-java-example/" style="box-sizing: border-box; color: #7dc246; font-weight: bold !important; text-decoration-line: none; transition: all 0.1s ease-in-out 0s;"&gt;Parameterized constructor&lt;/a&gt;.&lt;/div&gt;
&lt;h4 style="background-color: white; box-sizing: border-box; color: #444542; font-family: &amp;quot;PT Sans&amp;quot;, &amp;quot;Trebuchet MS&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 20px; line-height: 1.2; margin: 0px 0px 16px;"&gt;
Example: parameterized constructor&lt;/h4&gt;
&lt;div style="background-color: white; box-sizing: border-box; color: #222426; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 17px; margin-bottom: 26px; padding: 0px;"&gt;
In this example we have a parameterized constructor with two parameters&amp;nbsp;&lt;code style="background-color: #eeeeee; box-sizing: border-box; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;"&gt;id&lt;/code&gt;&amp;nbsp;and&amp;nbsp;&lt;code style="background-color: #eeeeee; box-sizing: border-box; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;"&gt;name&lt;/code&gt;. While creating the objects&amp;nbsp;&lt;code style="background-color: #eeeeee; box-sizing: border-box; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;"&gt;obj1&lt;/code&gt;&amp;nbsp;and&amp;nbsp;&lt;code style="background-color: #eeeeee; box-sizing: border-box; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;"&gt;obj2&lt;/code&gt;&amp;nbsp;I have passed two arguments so that this constructor gets invoked after creation of obj1 and obj2.&lt;/div&gt;
&lt;pre class="prettyprint prettyprinted" style="background-color: #eeeeee; box-sizing: border-box; clear: both; color: #222426; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; overflow: auto; padding: 2px;"&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;public&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;class&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;Employee&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;{&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;

   &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;int&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; empId&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;  
   &lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;String&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; empName&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;  
     
   &lt;/span&gt;&lt;span class="com" style="box-sizing: border-box; color: grey;"&gt;//parameterized constructor with two parameters&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
   &lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;Employee&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;(&lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;int&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; id&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;,&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;String&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; name&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;){&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;  
       &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;this&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;.&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;empId &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;=&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; id&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;  
       &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;this&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;.&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;empName &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;=&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; name&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;  
   &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;}&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;  
   &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;void&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; info&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;(){&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
        &lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;System&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;.&lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;out&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;.&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;println&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;(&lt;/span&gt;&lt;span class="str" style="box-sizing: border-box; color: maroon;"&gt;"Id: "&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;+&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;empId&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;+&lt;/span&gt;&lt;span class="str" style="box-sizing: border-box; color: maroon;"&gt;" Name: "&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;+&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;empName&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;);&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
   &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;}&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;  
    
   &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;public&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;static&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;void&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; main&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;(&lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;String&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; args&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;[]){&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;  
 &lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;Employee&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; obj1 &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;=&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;new&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;Employee&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;(&lt;/span&gt;&lt;span class="lit" style="box-sizing: border-box; color: maroon;"&gt;10245&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;,&lt;/span&gt;&lt;span class="str" style="box-sizing: border-box; color: maroon;"&gt;"Chaitanya"&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;);&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;  
 &lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;Employee&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; obj2 &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;=&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;new&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;Employee&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;(&lt;/span&gt;&lt;span class="lit" style="box-sizing: border-box; color: maroon;"&gt;92232&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;,&lt;/span&gt;&lt;span class="str" style="box-sizing: border-box; color: maroon;"&gt;"Negan"&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;);&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;  
 obj1&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;.&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;info&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;();&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;  
 obj2&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;.&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;info&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;();&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;  
   &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;}&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;  
&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;div style="background-color: white; box-sizing: border-box; color: #222426; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 17px; margin-bottom: 26px; padding: 0px;"&gt;
&lt;span style="box-sizing: border-box; font-weight: 700;"&gt;Output:&lt;/span&gt;&lt;/div&gt;
&lt;pre class="prettyprint prettyprinted" style="background-color: #eeeeee; box-sizing: border-box; clear: both; color: #222426; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; overflow: auto; padding: 2px;"&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;Id&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;:&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="lit" style="box-sizing: border-box; color: maroon;"&gt;10245&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;Name&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;:&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;Chaitanya&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
&lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;Id&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;:&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="lit" style="box-sizing: border-box; color: maroon;"&gt;92232&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;Name&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;:&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;Negan&lt;/span&gt;&lt;/pre&gt;
&lt;h4 style="background-color: white; box-sizing: border-box; color: #444542; font-family: &amp;quot;PT Sans&amp;quot;, &amp;quot;Trebuchet MS&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 20px; line-height: 1.2; margin: 0px 0px 16px;"&gt;
Example2: parameterized constructor&lt;/h4&gt;
&lt;div style="background-color: white; box-sizing: border-box; color: #222426; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 17px; margin-bottom: 26px; padding: 0px;"&gt;
In this example, we have two constructors, a default constructor and a parameterized constructor. When we do not pass any parameter while creating the object using new keyword then default constructor is invoked, however when you pass a parameter then parameterized constructor that matches with the passed parameters list gets invoked.&lt;/div&gt;
&lt;pre class="prettyprint prettyprinted" style="background-color: #eeeeee; box-sizing: border-box; clear: both; color: #222426; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; overflow: auto; padding: 2px;"&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;class&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;Example2&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;{&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
      &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;private&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;int&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;var&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
      &lt;/span&gt;&lt;span class="com" style="box-sizing: border-box; color: grey;"&gt;//default constructor&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
      &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;public&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;Example2&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;()&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
      &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;{&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
             &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;this&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;.&lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;var&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;=&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="lit" style="box-sizing: border-box; color: maroon;"&gt;10&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
      &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;}&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
      &lt;/span&gt;&lt;span class="com" style="box-sizing: border-box; color: grey;"&gt;//parameterized constructor&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
      &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;public&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;Example2&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;(&lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;int&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; num&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;)&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
      &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;{&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
             &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;this&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;.&lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;var&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;=&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; num&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
      &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;}&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
      &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;public&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;int&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; getValue&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;()&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
      &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;{&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
              &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;return&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;var&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
      &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;}&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
      &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;public&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;static&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;void&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; main&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;(&lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;String&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; args&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;[])&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
      &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;{&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
              &lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;Example2&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; obj &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;=&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;new&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;Example2&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;();&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
              &lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;Example2&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; obj2 &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;=&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;new&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;Example2&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;(&lt;/span&gt;&lt;span class="lit" style="box-sizing: border-box; color: maroon;"&gt;100&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;);&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
              &lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;System&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;.&lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;out&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;.&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;println&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;(&lt;/span&gt;&lt;span class="str" style="box-sizing: border-box; color: maroon;"&gt;"var is: "&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;+&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;obj&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;.&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;getValue&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;());&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
              &lt;/span&gt;&lt;span class="typ" style="box-sizing: border-box; color: #2b91af;"&gt;System&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;.&lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;out&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;.&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;println&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;(&lt;/span&gt;&lt;span class="str" style="box-sizing: border-box; color: maroon;"&gt;"var is: "&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;+&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;obj2&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;.&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;getValue&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;());&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
      &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;}&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;}&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;div style="background-color: white; box-sizing: border-box; color: #222426; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 17px; margin-bottom: 26px; padding: 0px;"&gt;
&lt;span style="box-sizing: border-box; font-weight: 700;"&gt;Output:&lt;/span&gt;&lt;/div&gt;
&lt;pre class="prettyprint prettyprinted" style="background-color: #eeeeee; box-sizing: border-box; clear: both; color: #222426; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; overflow: auto; padding: 2px;"&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;var&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;is&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;:&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="lit" style="box-sizing: border-box; color: maroon;"&gt;10&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="prettyprint prettyprinted" style="background-color: #eeeeee; box-sizing: border-box; clear: both; color: #222426; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; overflow: auto; padding: 2px;"&gt;&lt;span class="lit" style="box-sizing: border-box; color: maroon;"&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;h2 style="background-color: white; box-sizing: border-box; color: #444542; font-family: &amp;quot;PT Sans&amp;quot;, &amp;quot;Trebuchet MS&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 26px; line-height: 1.2; margin: 0px 0px 16px;"&gt;
&lt;/h2&gt;
&lt;h2 style="background-color: white; box-sizing: border-box; color: #444542; font-family: &amp;quot;PT Sans&amp;quot;, &amp;quot;Trebuchet MS&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 26px; line-height: 1.2; margin: 0px 0px 16px;"&gt;
Constructor Overloading&lt;/h2&gt;
&lt;div style="background-color: white; box-sizing: border-box; color: #222426; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 17px; margin-bottom: 26px; padding: 0px;"&gt;
Constructor overloading is a concept of having more than one constructor with different parameters list, in such a way so that each constructor performs a different task.&lt;br /&gt;
&lt;img alt="constructor overloading" class="aligncenter size-full wp-image-6643" height="300" sizes="(max-width: 500px) 100vw, 500px" src="https://beginnersbook.com/wp-content/uploads/2013/05/constructor_overloading.jpg" srcset="https://beginnersbook.com/wp-content/uploads/2013/05/constructor_overloading.jpg 500w, https://beginnersbook.com/wp-content/uploads/2013/05/constructor_overloading-300x180.jpg 300w" style="border: 0px; box-sizing: border-box; display: block; height: auto; margin: 0px auto 20px; max-width: 100%;" width="500" /&gt;&lt;/div&gt;
&lt;div style="background-color: white; box-sizing: border-box; color: #222426; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 17px; margin-bottom: 26px; padding: 0px;"&gt;
Refer&amp;nbsp;&lt;a href="https://beginnersbook.com/2013/05/constructor-overloading/" style="box-sizing: border-box; color: #7dc246; font-weight: bold !important; text-decoration-line: none; transition: all 0.1s ease-in-out 0s;"&gt;constructor overloading with example&lt;/a&gt;for more details with example.&lt;/div&gt;
&lt;pre class="prettyprint prettyprinted" style="background-color: #eeeeee; box-sizing: border-box; clear: both; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; overflow: auto; padding: 2px;"&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;
&lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;var&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: darkblue;"&gt;is&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: black;"&gt;:&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box; color: black;"&gt; &lt;/span&gt;&lt;span class="lit" style="box-sizing: border-box; color: maroon;"&gt;100&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="prettyprint prettyprinted" style="background-color: #eeeeee; box-sizing: border-box; clear: both; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; overflow: auto; padding: 2px;"&gt;&lt;span class="lit" style="box-sizing: border-box; color: maroon;"&gt;&lt;h2 style="background-color: white; box-sizing: border-box; color: #444542; font-family: &amp;quot;PT Sans&amp;quot;, &amp;quot;Trebuchet MS&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 26px; line-height: 1.2; margin: 0px 0px 16px; white-space: normal;"&gt;
&lt;/h2&gt;
&lt;h2 style="background-color: white; box-sizing: border-box; color: #444542; font-family: &amp;quot;PT Sans&amp;quot;, &amp;quot;Trebuchet MS&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 26px; line-height: 1.2; margin: 0px 0px 16px; white-space: normal;"&gt;
Difference between Constructor and Method&lt;/h2&gt;
&lt;div style="background-color: white; box-sizing: border-box; color: #222426; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 17px; margin-bottom: 26px; padding: 0px; white-space: normal;"&gt;
I know I should have mentioned it at the beginning of this guide but I wanted to cover everything in a flow. Hope you don’t mind :)&lt;/div&gt;
&lt;ol style="background-color: white; box-sizing: border-box; color: #222426; font-family: &amp;quot;PT Sans&amp;quot;, Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 17px; margin: 0px 0px 26px 40px; padding: 0px; white-space: normal;"&gt;
&lt;li style="box-sizing: border-box; list-style-type: decimal;"&gt;The purpose of constructor is to initialize the object of a class while the purpose of a method is to perform a task by executing java code.&lt;/li&gt;
&lt;li style="box-sizing: border-box; list-style-type: decimal;"&gt;Constructors cannot be abstract, final, static and synchronised while methods can be.&lt;/li&gt;
&lt;li style="box-sizing: border-box; list-style-type: decimal;"&gt;Constructors do not have return types while methods do&lt;/li&gt;
&lt;/ol&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
</description><link>https://tweetprogrammer.blogspot.com/2019/05/constructor-in-java.html</link><author>noreply@blogger.com (Mohammad Saquib Khan)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinIU4L9mueFBycxAmy-67qJ-zwr3sh0CYn6-IhIa90qte34s3d2kj9d7L23Oyyd1ons7-LmUxJ1hKi2WRXJdF0mBEoeoX4Gm22eL115BB1dmL-nkoptCv6mEtGwWK1Ugv3uY0tZkxofqMT/s72-c/Logo-1558758020058.png" width="72"/><thr:total>0</thr:total><georss:featurename>UPSIDC Industrial Area, Naini, Prayagraj, Uttar Pradesh 211009, India</georss:featurename><georss:point>25.3431443 81.910167099999967</georss:point><georss:box>-3.0671897 40.601573099999968 53.7534783 123.21876109999997</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7867323827570382405.post-731662266773431164</guid><pubDate>Wed, 01 May 2019 20:37:00 +0000</pubDate><atom:updated>2019-05-24T21:40:26.803-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">C language</category><category domain="http://www.blogger.com/atom/ns#">Pointers</category><title>Pointer's in C</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div style="box-sizing: border-box; font-family: Verdana, Geneva, Tahoma, Arial, Helvetica, sans-serif; font-size: 15px !important; line-height: 24px; margin: 0em 0.2em 0.6em; overflow-wrap: break-word; padding: 0px; text-align: justify;"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUqqVEhDHDPHatjXhyphenhyphennYiH18P7es0pd9S0eArvD3FvTX_nm3-GD0AntuaLjJDNY-pqXfzzsbC1JhHQFkq6lcLmCW_VxfmfJP9WZXVihdpSSEWfAAE4bvE_dtfM4WbLsePNb8c7rtwWdrI8/s1600/Logo-1558759045550.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;img border="0" data-original-height="1000" data-original-width="1000" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUqqVEhDHDPHatjXhyphenhyphennYiH18P7es0pd9S0eArvD3FvTX_nm3-GD0AntuaLjJDNY-pqXfzzsbC1JhHQFkq6lcLmCW_VxfmfJP9WZXVihdpSSEWfAAE4bvE_dtfM4WbLsePNb8c7rtwWdrI8/s320/Logo-1558759045550.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
Pointers in C are easy and fun to learn. Some C programming tasks are performed more easily with pointers, and other tasks, such as dynamic memory allocation, cannot be performed without using pointers. So it becomes necessary to learn pointers to become a perfect C programmer. Let's start learning them in simple and easy steps.&lt;/div&gt;
&lt;div style="box-sizing: border-box; font-family: Verdana, Geneva, Tahoma, Arial, Helvetica, sans-serif; font-size: 15px !important; line-height: 24px; margin: 0em 0.2em 0.6em; overflow-wrap: break-word; padding: 0px; text-align: justify;"&gt;
As you know, every variable is a memory location and every memory location has its address defined which can be accessed using ampersand (&amp;amp;) operator, which denotes an address in memory. Consider the following example, which prints the address of the variables defined −&lt;/div&gt;
&lt;a class="demo" href="http://tpcg.io/SxljuD" rel="nofollow" style="background: rgb(201, 106, 20); border: 1px solid rgb(214, 214, 214); box-sizing: border-box; color: white; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 13px; margin: -6px 17px 0px 0px; outline: none !important; padding: 3px 10px; position: absolute; right: 5px; text-decoration-line: none;" target="_blank"&gt;&lt;i class="fa-external-link" style="box-sizing: border-box;"&gt;&lt;/i&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;br /&gt;
&lt;pre class="prettyprint notranslate prettyprinted" style="background-color: #eeeeee; border-radius: 0px; border: 1px solid rgb(214, 214, 214); box-sizing: border-box; color: #313131; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 16px; margin-bottom: 10px; margin-top: 15px; overflow: auto; padding: 5px; width: 348px;"&gt;&lt;span class="com" style="box-sizing: border-box; color: #880000;"&gt;#include&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; &lt;/span&gt;&lt;span class="str" style="box-sizing: border-box; color: #008800;"&gt;&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;

&lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;int&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; main &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;()&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;{&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;

   &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;int&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;  var1&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;
   &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;char&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; var2&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;[&lt;/span&gt;&lt;span class="lit" style="box-sizing: border-box; color: #006666;"&gt;10&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;];&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;

   printf&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;(&lt;/span&gt;&lt;span class="str" style="box-sizing: border-box; color: #008800;"&gt;"Address of var1 variable: %x\n"&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;,&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;&amp;amp;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;var1  &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;);&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;
   printf&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;(&lt;/span&gt;&lt;span class="str" style="box-sizing: border-box; color: #008800;"&gt;"Address of var2 variable: %x\n"&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;,&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;&amp;amp;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;var2  &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;);&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;

   &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;return&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; &lt;/span&gt;&lt;span class="lit" style="box-sizing: border-box; color: #006666;"&gt;0&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;
&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;div style="box-sizing: border-box; font-family: Verdana, Geneva, Tahoma, Arial, Helvetica, sans-serif; font-size: 15px !important; line-height: 24px; margin: 0em 0.2em 0.6em; overflow-wrap: break-word; padding: 0px; text-align: justify;"&gt;
When the above code is compiled and executed, it produces the following result −&lt;/div&gt;
&lt;pre class="result notranslate" style="background-color: #f1f1f1; border-radius: 0px; border: 1px solid rgb(214, 214, 214); box-sizing: border-box; color: #313131; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; overflow: auto; padding: 5px; width: 348px;"&gt;Address of var1 variable: bff5a400
Address of var2 variable: bff5a3f6
&lt;/pre&gt;
&lt;h2 style="box-sizing: border-box; color: #121214; font-family: Verdana, Geneva, Tahoma, Arial, Helvetica, sans-serif; font-size: 21px; font-weight: normal; left: 0px; letter-spacing: -1px; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; position: relative; text-shadow: rgb(204, 204, 204) 1px 1px 2px;"&gt;
What are Pointers?&lt;/h2&gt;
&lt;div style="box-sizing: border-box; font-family: Verdana, Geneva, Tahoma, Arial, Helvetica, sans-serif; font-size: 15px !important; line-height: 24px; margin: 0em 0.2em 0.6em; overflow-wrap: break-word; padding: 0px; text-align: justify;"&gt;
A&amp;nbsp;&lt;span style="box-sizing: border-box; font-weight: 640;"&gt;pointer&lt;/span&gt;&amp;nbsp;is a variable whose value is the address of another variable, i.e., direct address of the memory location. Like any variable or constant, you must declare a pointer before using it to store any variable address. The general form of a pointer variable declaration is −&lt;/div&gt;
&lt;pre class="result notranslate" style="background-color: #f1f1f1; border-radius: 0px; border: 1px solid rgb(214, 214, 214); box-sizing: border-box; color: #313131; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; overflow: auto; padding: 5px; width: 348px;"&gt;type *var-name;
&lt;/pre&gt;
&lt;div style="box-sizing: border-box; font-family: Verdana, Geneva, Tahoma, Arial, Helvetica, sans-serif; font-size: 15px !important; line-height: 24px; margin: 0em 0.2em 0.6em; overflow-wrap: break-word; padding: 0px; text-align: justify;"&gt;
Here,&amp;nbsp;&lt;span style="box-sizing: border-box; font-weight: 640;"&gt;type&lt;/span&gt;&amp;nbsp;is the pointer's base type; it must be a valid C data type and&amp;nbsp;&lt;span style="box-sizing: border-box; font-weight: 640;"&gt;var-name&lt;/span&gt;&amp;nbsp;is the name of the pointer variable. The asterisk * used to declare a pointer is the same asterisk used for multiplication. However, in this statement the asterisk is being used to designate a variable as a pointer. Take a look at some of the valid pointer declarations −&lt;/div&gt;
&lt;pre class="result notranslate" style="background-color: #f1f1f1; border-radius: 0px; border: 1px solid rgb(214, 214, 214); box-sizing: border-box; color: #313131; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; overflow: auto; padding: 5px; width: 348px;"&gt;int    *ip;    /* pointer to an integer */
double *dp;    /* pointer to a double */
float  *fp;    /* pointer to a float */
char   *ch     /* pointer to a character */
&lt;/pre&gt;
&lt;div style="box-sizing: border-box; font-family: Verdana, Geneva, Tahoma, Arial, Helvetica, sans-serif; font-size: 15px !important; line-height: 24px; margin: 0em 0.2em 0.6em; overflow-wrap: break-word; padding: 0px; text-align: justify;"&gt;
The actual data type of the value of all pointers, whether integer, float, character, or otherwise, is the same, a long hexadecimal number that represents a memory address. The only difference between pointers of different data types is the data type of the variable or constant that the pointer points to.&lt;/div&gt;
&lt;h2 style="box-sizing: border-box; color: #121214; font-family: Verdana, Geneva, Tahoma, Arial, Helvetica, sans-serif; font-size: 21px; font-weight: normal; left: 0px; letter-spacing: -1px; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; position: relative; text-shadow: rgb(204, 204, 204) 1px 1px 2px;"&gt;
How to Use Pointers?&lt;/h2&gt;
&lt;div style="box-sizing: border-box; font-family: Verdana, Geneva, Tahoma, Arial, Helvetica, sans-serif; font-size: 15px !important; line-height: 24px; margin: 0em 0.2em 0.6em; overflow-wrap: break-word; padding: 0px; text-align: justify;"&gt;
There are a few important operations, which we will do with the help of pointers very frequently.&amp;nbsp;&lt;span style="box-sizing: border-box; font-weight: 640;"&gt;(a)&lt;/span&gt;&amp;nbsp;We define a pointer variable,&amp;nbsp;&lt;span style="box-sizing: border-box; font-weight: 640;"&gt;(b)&lt;/span&gt;&amp;nbsp;assign the address of a variable to a pointer and&amp;nbsp;&lt;span style="box-sizing: border-box; font-weight: 640;"&gt;(c)&lt;/span&gt;&amp;nbsp;finally access the value at the address available in the pointer variable. This is done by using unary operator&amp;nbsp;&lt;span style="box-sizing: border-box; font-weight: 640;"&gt;*&lt;/span&gt;&amp;nbsp;that returns the value of the variable located at the address specified by its operand. The following example makes use of these operations −&lt;/div&gt;
&lt;div style="box-sizing: border-box; font-family: Verdana, Geneva, Tahoma, Arial, Helvetica, sans-serif; font-size: 15px !important; line-height: 24px; margin: 0em 0.2em 0.6em; overflow-wrap: break-word; padding: 0px; text-align: justify;"&gt;
&lt;a class="demo" href="http://tpcg.io/Lt9V7y" rel="nofollow" style="background: rgb(201, 106, 20); border: 1px solid rgb(214, 214, 214); box-sizing: border-box; color: white; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 13px; margin: -6px 17px 0px 0px; outline: none !important; padding: 3px 10px; position: absolute; right: 5px; text-align: start; text-decoration-line: none;" target="_blank"&gt;&lt;i class="fa-external-link" style="box-sizing: border-box;"&gt;&lt;/i&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/div&gt;
&lt;pre class="prettyprint notranslate prettyprinted" style="background-color: #eeeeee; border-radius: 0px; border: 1px solid rgb(214, 214, 214); box-sizing: border-box; color: #313131; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 16px; margin-bottom: 10px; margin-top: 15px; overflow: auto; padding: 5px; width: 348px;"&gt;&lt;span class="com" style="box-sizing: border-box; color: #880000;"&gt;#include&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; &lt;/span&gt;&lt;span class="str" style="box-sizing: border-box; color: #008800;"&gt;&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;

&lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;int&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; main &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;()&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;{&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;

   &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;int&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;  &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;var&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;=&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; &lt;/span&gt;&lt;span class="lit" style="box-sizing: border-box; color: #006666;"&gt;20&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;   &lt;/span&gt;&lt;span class="com" style="box-sizing: border-box; color: #880000;"&gt;/* actual variable declaration */&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;
   &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;int&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;  &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;*&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;ip&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;        &lt;/span&gt;&lt;span class="com" style="box-sizing: border-box; color: #880000;"&gt;/* pointer variable declaration */&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;

   ip &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;=&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;&amp;amp;&lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;var&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;  &lt;/span&gt;&lt;span class="com" style="box-sizing: border-box; color: #880000;"&gt;/* store address of var in pointer variable*/&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;

   printf&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;(&lt;/span&gt;&lt;span class="str" style="box-sizing: border-box; color: #008800;"&gt;"Address of var variable: %x\n"&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;,&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;&amp;amp;&lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;var&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;  &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;);&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;

   &lt;/span&gt;&lt;span class="com" style="box-sizing: border-box; color: #880000;"&gt;/* address stored in pointer variable */&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;
   printf&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;(&lt;/span&gt;&lt;span class="str" style="box-sizing: border-box; color: #008800;"&gt;"Address stored in ip variable: %x\n"&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;,&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; ip &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;);&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;

   &lt;/span&gt;&lt;span class="com" style="box-sizing: border-box; color: #880000;"&gt;/* access the value using the pointer */&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;
   printf&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;(&lt;/span&gt;&lt;span class="str" style="box-sizing: border-box; color: #008800;"&gt;"Value of *ip variable: %d\n"&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;,&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;*&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;ip &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;);&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;

   &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;return&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; &lt;/span&gt;&lt;span class="lit" style="box-sizing: border-box; color: #006666;"&gt;0&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;
&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;div style="box-sizing: border-box; font-family: Verdana, Geneva, Tahoma, Arial, Helvetica, sans-serif; font-size: 15px !important; line-height: 24px; margin: 0em 0.2em 0.6em; overflow-wrap: break-word; padding: 0px; text-align: justify;"&gt;
When the above code is compiled and executed, it produces the following result −&lt;/div&gt;
&lt;pre class="result notranslate" style="background-color: #f1f1f1; border-radius: 0px; border: 1px solid rgb(214, 214, 214); box-sizing: border-box; color: #313131; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; overflow: auto; padding: 5px; width: 348px;"&gt;Address of var variable: bffd8b3c
Address stored in ip variable: bffd8b3c
Value of *ip variable: 20
&lt;/pre&gt;
&lt;h2 style="box-sizing: border-box; color: #121214; font-family: Verdana, Geneva, Tahoma, Arial, Helvetica, sans-serif; font-size: 21px; font-weight: normal; left: 0px; letter-spacing: -1px; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; position: relative; text-shadow: rgb(204, 204, 204) 1px 1px 2px;"&gt;
NULL Pointers&lt;/h2&gt;
&lt;div style="box-sizing: border-box; font-family: Verdana, Geneva, Tahoma, Arial, Helvetica, sans-serif; font-size: 15px !important; line-height: 24px; margin: 0em 0.2em 0.6em; overflow-wrap: break-word; padding: 0px; text-align: justify;"&gt;
It is always a good practice to assign a NULL value to a pointer variable in case you do not have an exact address to be assigned. This is done at the time of variable declaration. A pointer that is assigned NULL is called a&amp;nbsp;&lt;span style="box-sizing: border-box; font-weight: 640;"&gt;null&lt;/span&gt;&amp;nbsp;pointer.&lt;/div&gt;
&lt;div style="box-sizing: border-box; font-family: Verdana, Geneva, Tahoma, Arial, Helvetica, sans-serif; font-size: 15px !important; line-height: 24px; margin: 0em 0.2em 0.6em; overflow-wrap: break-word; padding: 0px; text-align: justify;"&gt;
The NULL pointer is a constant with a value of zero defined in several standard libraries. Consider the following program −&lt;/div&gt;
&lt;pre class="prettyprint notranslate prettyprinted" style="background-color: #eeeeee; border-radius: 0px; border: 1px solid rgb(214, 214, 214); box-sizing: border-box; color: #313131; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 16px; margin-bottom: 10px; margin-top: 15px; overflow: auto; padding: 5px; width: 348px;"&gt;&lt;span class="com" style="box-sizing: border-box; color: #880000;"&gt;#include&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; &lt;/span&gt;&lt;span class="str" style="box-sizing: border-box; color: #008800;"&gt;&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;

&lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;int&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; main &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;()&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;{&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;

   &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;int&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;  &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;*&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;ptr &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;=&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; NULL&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;

   printf&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;(&lt;/span&gt;&lt;span class="str" style="box-sizing: border-box; color: #008800;"&gt;"The value of ptr is : %x\n"&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;,&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; ptr  &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;);&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;
 
   &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;return&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; &lt;/span&gt;&lt;span class="lit" style="box-sizing: border-box; color: #006666;"&gt;0&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;
&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;div style="box-sizing: border-box; font-family: Verdana, Geneva, Tahoma, Arial, Helvetica, sans-serif; font-size: 15px !important; line-height: 24px; margin: 0em 0.2em 0.6em; overflow-wrap: break-word; padding: 0px; text-align: justify;"&gt;
When the above code is compiled and executed, it produces the following result −&lt;/div&gt;
&lt;pre class="result notranslate" style="background-color: #f1f1f1; border-radius: 0px; border: 1px solid rgb(214, 214, 214); box-sizing: border-box; color: #313131; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; overflow: auto; padding: 5px; width: 348px;"&gt;The value of ptr is 0
&lt;/pre&gt;
&lt;div style="box-sizing: border-box; font-family: Verdana, Geneva, Tahoma, Arial, Helvetica, sans-serif; font-size: 15px !important; line-height: 24px; margin: 0em 0.2em 0.6em; overflow-wrap: break-word; padding: 0px; text-align: justify;"&gt;
In most of the operating systems, programs are not permitted to access memory at address 0 because that memory is reserved by the operating system. However, the memory address 0 has special significance; it signals that the pointer is not intended to point to an accessible memory location. But by convention, if a pointer contains the null (zero) value, it is assumed to point to nothing.&lt;/div&gt;
&lt;div style="box-sizing: border-box; font-family: Verdana, Geneva, Tahoma, Arial, Helvetica, sans-serif; font-size: 15px !important; line-height: 24px; margin: 0em 0.2em 0.6em; overflow-wrap: break-word; padding: 0px; text-align: justify;"&gt;
To check for a null pointer, you can use an 'if' statement as follows −&lt;/div&gt;
&lt;pre class="result notranslate" style="background-color: #f1f1f1; border-radius: 0px; border: 1px solid rgb(214, 214, 214); box-sizing: border-box; color: #313131; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; overflow: auto; padding: 5px; width: 348px;"&gt;if(ptr)     /* succeeds if p is not null */
if(!ptr)    /* succeeds if p is null */
&lt;/pre&gt;
&lt;h2 style="box-sizing: border-box; color: #121214; font-family: Verdana, Geneva, Tahoma, Arial, Helvetica, sans-serif; font-size: 21px; font-weight: normal; left: 0px; letter-spacing: -1px; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; position: relative; text-shadow: rgb(204, 204, 204) 1px 1px 2px;"&gt;
Pointers in Detail&lt;/h2&gt;
&lt;div&gt;
&lt;div style="box-sizing: border-box; font-family: Verdana, Geneva, Tahoma, Arial, Helvetica, sans-serif; font-size: 15px !important; line-height: 24px; margin: 0em 0.2em 0.6em; overflow-wrap: break-word; padding: 0px; text-align: justify;"&gt;
Pointers have many but easy concepts and they are very important to C programming. The following important pointer concepts should be clear to any C programmer −&lt;/div&gt;
&lt;table class="table table-bordered" style="border-collapse: collapse; border-spacing: 0px; border: 1px solid rgb(221, 221, 221); box-sizing: border-box; color: #313131; font-family: Verdana, Geneva, Tahoma, Arial, Helvetica, sans-serif; font-size: 14px; margin-bottom: 20px; max-width: 100%; width: 348px;"&gt;&lt;tbody style="box-sizing: border-box;"&gt;
&lt;tr style="box-sizing: border-box;"&gt;&lt;th style="background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); box-sizing: border-box; line-height: 1.42857; padding: 8px; text-align: center; vertical-align: top;"&gt;Sr.No.&lt;/th&gt;&lt;th style="background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); box-sizing: border-box; line-height: 1.42857; padding: 8px; text-align: center; vertical-align: top;"&gt;Concept &amp;amp; Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr style="box-sizing: border-box;"&gt;&lt;td class="ts" style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; line-height: 1.42857; padding: 8px; text-align: center !important; vertical-align: top;"&gt;1&lt;/td&gt;&lt;td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; line-height: 1.42857; padding: 8px; vertical-align: top;"&gt;&lt;a href="https://www.tutorialspoint.com/cprogramming/c_pointer_arithmetic.htm" style="background-attachment: initial; background-clip: initial; background-image: url(&amp;quot;/images/link-icon.png&amp;quot;); background-origin: initial; background-position: right center; background-repeat: no-repeat; background-size: initial; box-sizing: border-box; color: #313131; font-weight: bold; outline: none !important; padding-bottom: 2px; padding-right: 22px; text-decoration-line: none;"&gt;Pointer arithmetic&lt;/a&gt;&lt;br /&gt;
&lt;div style="box-sizing: border-box; color: black; font-size: 15px !important; line-height: 24px; margin: 0em 0.2em 0.6em; overflow-wrap: break-word; padding: 0px; text-align: justify;"&gt;
There are four arithmetic operators that can be used in pointers: ++, --, +, -&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="box-sizing: border-box;"&gt;&lt;td class="ts" style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; line-height: 1.42857; padding: 8px; text-align: center !important; vertical-align: top;"&gt;2&lt;/td&gt;&lt;td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; line-height: 1.42857; padding: 8px; vertical-align: top;"&gt;&lt;a href="https://www.tutorialspoint.com/cprogramming/c_array_of_pointers.htm" style="background-attachment: initial; background-clip: initial; background-image: url(&amp;quot;/images/link-icon.png&amp;quot;); background-origin: initial; background-position: right center; background-repeat: no-repeat; background-size: initial; box-sizing: border-box; color: #313131; font-weight: bold; outline: none !important; padding-bottom: 2px; padding-right: 22px; text-decoration-line: none;"&gt;Array of pointers&lt;/a&gt;&lt;br /&gt;
&lt;div style="box-sizing: border-box; color: black; font-size: 15px !important; line-height: 24px; margin: 0em 0.2em 0.6em; overflow-wrap: break-word; padding: 0px; text-align: justify;"&gt;
You can define arrays to hold a number of pointers.&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="box-sizing: border-box;"&gt;&lt;td class="ts" style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; line-height: 1.42857; padding: 8px; text-align: center !important; vertical-align: top;"&gt;3&lt;/td&gt;&lt;td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; line-height: 1.42857; padding: 8px; vertical-align: top;"&gt;&lt;a href="https://www.tutorialspoint.com/cprogramming/c_pointer_to_pointer.htm" style="background-attachment: initial; background-clip: initial; background-image: url(&amp;quot;/images/link-icon.png&amp;quot;); background-origin: initial; background-position: right center; background-repeat: no-repeat; background-size: initial; box-sizing: border-box; color: #313131; font-weight: bold; outline: none !important; padding-bottom: 2px; padding-right: 22px; text-decoration-line: none;"&gt;Pointer to pointer&lt;/a&gt;&lt;br /&gt;
&lt;div style="box-sizing: border-box; color: black; font-size: 15px !important; line-height: 24px; margin: 0em 0.2em 0.6em; overflow-wrap: break-word; padding: 0px; text-align: justify;"&gt;
C allows you to have pointer on a pointer and so on.&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="box-sizing: border-box;"&gt;&lt;td class="ts" style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; line-height: 1.42857; padding: 8px; text-align: center !important; vertical-align: top;"&gt;4&lt;/td&gt;&lt;td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; line-height: 1.42857; padding: 8px; vertical-align: top;"&gt;&lt;a href="https://www.tutorialspoint.com/cprogramming/c_passing_pointers_to_functions.htm" style="background-attachment: initial; background-clip: initial; background-image: url(&amp;quot;/images/link-icon.png&amp;quot;); background-origin: initial; background-position: right center; background-repeat: no-repeat; background-size: initial; box-sizing: border-box; color: #313131; font-weight: bold; outline: none !important; padding-bottom: 2px; padding-right: 22px; text-decoration-line: none;"&gt;Passing pointers to functions in C&lt;/a&gt;&lt;br /&gt;
&lt;div style="box-sizing: border-box; color: black; font-size: 15px !important; line-height: 24px; margin: 0em 0.2em 0.6em; overflow-wrap: break-word; padding: 0px; text-align: justify;"&gt;
Passing an argument by reference or by address enable the passed argument to be changed in the calling function by the called function.&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="box-sizing: border-box;"&gt;&lt;td class="ts" style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; line-height: 1.42857; padding: 8px; text-align: center !important; vertical-align: top;"&gt;5&lt;/td&gt;&lt;td style="border: 1px solid rgb(221, 221, 221); box-sizing: border-box; line-height: 1.42857; padding: 8px; vertical-align: top;"&gt;&lt;a href="https://www.tutorialspoint.com/cprogramming/c_return_pointer_from_functions.htm" style="background-attachment: initial; background-clip: initial; background-image: url(&amp;quot;/images/link-icon.png&amp;quot;); background-origin: initial; background-position: right center; background-repeat: no-repeat; background-size: initial; box-sizing: border-box; color: #313131; font-weight: bold; outline: none !important; padding-bottom: 2px; padding-right: 22px; text-decoration-line: none;"&gt;Return pointer from functions in C&lt;/a&gt;&lt;br /&gt;
&lt;div style="box-sizing: border-box; color: black; font-size: 15px !important; line-height: 24px; margin: 0em 0.2em 0.6em; overflow-wrap: break-word; padding: 0px; text-align: justify;"&gt;
C allows a function to return a pointer to the local variable, static variable, and dynamically allocated memory as well.&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div style="box-sizing: border-box; font-family: Verdana, Geneva, Tahoma, Arial, Helvetica, sans-serif; font-size: 15px !important; line-height: 24px; margin: 0em 0.2em 0.6em; overflow-wrap: break-word; padding: 0px; text-align: justify;"&gt;
&lt;a class="demo" href="http://tpcg.io/xGfUyr" rel="nofollow" style="background: rgb(201, 106, 20); border: 1px solid rgb(214, 214, 214); box-sizing: border-box; color: white; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 13px; margin: -6px 17px 0px 0px; outline: none !important; padding: 3px 10px; position: absolute; right: 5px; text-align: start; text-decoration-line: none;" target="_blank"&gt;&lt;i class="fa-external-link" style="box-sizing: border-box;"&gt;&lt;/i&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
</description><link>https://tweetprogrammer.blogspot.com/2019/05/pointers-in-c.html</link><author>noreply@blogger.com (Mohammad Saquib Khan)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUqqVEhDHDPHatjXhyphenhyphennYiH18P7es0pd9S0eArvD3FvTX_nm3-GD0AntuaLjJDNY-pqXfzzsbC1JhHQFkq6lcLmCW_VxfmfJP9WZXVihdpSSEWfAAE4bvE_dtfM4WbLsePNb8c7rtwWdrI8/s72-c/Logo-1558759045550.png" width="72"/><thr:total>0</thr:total><georss:featurename>UPSIDC Industrial Area, Naini, Prayagraj, Uttar Pradesh 211009, India</georss:featurename><georss:point>25.3431443 81.910167099999967</georss:point><georss:box>-3.0674817000000019 40.601573099999968 53.7537703 123.21876109999997</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7867323827570382405.post-4226769938659045436</guid><pubDate>Wed, 01 May 2019 07:53:00 +0000</pubDate><atom:updated>2019-05-24T21:47:24.543-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">array</category><category domain="http://www.blogger.com/atom/ns#">C language</category><title>Array in C Language. </title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="post-body entry-content float-container" id="post-body-8262640836279812369" style="background-color: white; color: #7a7a7a; font-family: Roboto, sans-serif; font-size: 15px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: 1.6em; margin: 1.5em 0px 2em;"&gt;
&lt;div dir="ltr" trbidi="on"&gt;
&lt;div style="box-sizing: border-box; font-family: Verdana, Geneva, Tahoma, Arial, Helvetica, sans-serif; line-height: 24px; margin: 0em 0.2em 0.6em; overflow-wrap: break-word; padding: 0px; text-align: justify;"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUCv0C2F_tB-ib0hvqBCJxgl0bkuxAc3rGUyKlZJ5bqaKyysB3JsQgIuWR6DI2OwclqUdeTTOvQSQ2PUh3dod9IlxSvwUytY58pcVrsW7hDo-pZxmPipduzNtZteBFHLSpyHbq_yjDD3WH/s1600/Logo-1558759360786.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;img border="0" data-original-height="1000" data-original-width="1000" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUCv0C2F_tB-ib0hvqBCJxgl0bkuxAc3rGUyKlZJ5bqaKyysB3JsQgIuWR6DI2OwclqUdeTTOvQSQ2PUh3dod9IlxSvwUytY58pcVrsW7hDo-pZxmPipduzNtZteBFHLSpyHbq_yjDD3WH/s320/Logo-1558759360786.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
Arrays a kind of data structure that can store a fixed-size sequential collection of elements of the same type. An array is used to store a collection of data, but it is often more useful to think of an array as a collection of variables of the same type.&lt;/div&gt;
&lt;div style="box-sizing: border-box; font-family: Verdana, Geneva, Tahoma, Arial, Helvetica, sans-serif; line-height: 24px; margin: 0em 0.2em 0.6em; overflow-wrap: break-word; padding: 0px; text-align: justify;"&gt;
Instead of declaring individual variables, such as number0, number1, ..., and number99, you declare one array variable such as numbers and use numbers[0], numbers[1], and ..., numbers[99] to represent individual variables. A specific element in an array is accessed by an index.&lt;/div&gt;
&lt;div style="box-sizing: border-box; font-family: Verdana, Geneva, Tahoma, Arial, Helvetica, sans-serif; line-height: 24px; margin: 0em 0.2em 0.6em; overflow-wrap: break-word; padding: 0px; text-align: justify;"&gt;
All arrays consist of contiguous memory locations. The lowest address corresponds to the first element and the highest address to the last element.&lt;/div&gt;
&lt;img alt="Arrays in C" src="https://www.tutorialspoint.com/cprogramming/images/arrays.jpg" style="border: 0px; box-sizing: border-box; color: #313131; display: block; font-family: Verdana, Geneva, Tahoma, Arial, Helvetica, sans-serif; font-size: 14px; height: inherit; margin-left: auto; margin-right: auto; max-width: 100%; padding-bottom: 4px; vertical-align: middle;" /&gt;&lt;br /&gt;
&lt;h2 style="box-sizing: border-box; color: #121214; font-family: Verdana, Geneva, Tahoma, Arial, Helvetica, sans-serif; font-size: 21px; font-weight: normal; left: 0px; letter-spacing: -1px; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; position: relative; text-shadow: rgb(204, 204, 204) 1px 1px 2px;"&gt;
Declaring Arrays&lt;/h2&gt;
&lt;div style="box-sizing: border-box; font-family: Verdana, Geneva, Tahoma, Arial, Helvetica, sans-serif; line-height: 24px; margin: 0em 0.2em 0.6em; overflow-wrap: break-word; padding: 0px; text-align: justify;"&gt;
To declare an array in C, a programmer specifies the type of the elements and the number of elements required by an array as follows −&lt;/div&gt;
&lt;pre class="result notranslate" style="background-color: #f1f1f1; border-radius: 0px; border: 1px solid rgb(214, 214, 214); box-sizing: border-box; color: #313131; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; overflow: auto; padding: 5px; width: 348px;"&gt;type arrayName [ arraySize ];
&lt;/pre&gt;
&lt;div style="box-sizing: border-box; font-family: Verdana, Geneva, Tahoma, Arial, Helvetica, sans-serif; line-height: 24px; margin: 0em 0.2em 0.6em; overflow-wrap: break-word; padding: 0px; text-align: justify;"&gt;
This is called a&amp;nbsp;&lt;i style="box-sizing: border-box;"&gt;single-dimensional&lt;/i&gt;&amp;nbsp;array. The&amp;nbsp;&lt;span style="box-sizing: border-box; font-weight: 640;"&gt;arraySize&lt;/span&gt;must be an integer constant greater than zero and&amp;nbsp;&lt;span style="box-sizing: border-box; font-weight: 640;"&gt;type&lt;/span&gt;&amp;nbsp;can be any valid C data type. For example, to declare a 10-element array called&amp;nbsp;&lt;span style="box-sizing: border-box; font-weight: 640;"&gt;balance&lt;/span&gt;&amp;nbsp;of type double, use this statement −&lt;/div&gt;
&lt;pre class="result notranslate" style="background-color: #f1f1f1; border-radius: 0px; border: 1px solid rgb(214, 214, 214); box-sizing: border-box; color: #313131; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; overflow: auto; padding: 5px; width: 348px;"&gt;double balance[10];
&lt;/pre&gt;
&lt;div style="box-sizing: border-box; font-family: Verdana, Geneva, Tahoma, Arial, Helvetica, sans-serif; line-height: 24px; margin: 0em 0.2em 0.6em; overflow-wrap: break-word; padding: 0px; text-align: justify;"&gt;
Here&amp;nbsp;&lt;i style="box-sizing: border-box;"&gt;balance&lt;/i&gt;&amp;nbsp;is a variable array which is sufficient to hold up to 10 double numbers.&lt;/div&gt;
&lt;div style="box-sizing: border-box; font-family: Verdana, Geneva, Tahoma, Arial, Helvetica, sans-serif; line-height: 24px; margin: 0em 0.2em 0.6em; overflow-wrap: break-word; padding: 0px; text-align: justify;"&gt;
&lt;h2 style="box-sizing: border-box; color: #121214; font-size: 21px; font-weight: normal; left: 0px; letter-spacing: -1px; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; position: relative; text-align: left; text-shadow: rgb(204, 204, 204) 1px 1px 2px;"&gt;
Initializing Arrays&lt;/h2&gt;
&lt;div style="box-sizing: border-box; line-height: 24px; margin: 0em 0.2em 0.6em; overflow-wrap: break-word; padding: 0px;"&gt;
You can initialize an array in C either one by one or using a single statement as follows −&lt;/div&gt;
&lt;pre class="result notranslate" style="background-color: #f1f1f1; border-radius: 0px; border: 1px solid rgb(214, 214, 214); box-sizing: border-box; color: #313131; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; overflow: auto; padding: 5px; text-align: left; width: 348px;"&gt;double balance[5] = {1000.0, 2.0, 3.4, 7.0, 50.0};
&lt;/pre&gt;
&lt;div style="box-sizing: border-box; line-height: 24px; margin: 0em 0.2em 0.6em; overflow-wrap: break-word; padding: 0px;"&gt;
The number of values between braces { } cannot be larger than the number of elements that we declare for the array between square brackets [ ].&lt;/div&gt;
&lt;div style="box-sizing: border-box; line-height: 24px; margin: 0em 0.2em 0.6em; overflow-wrap: break-word; padding: 0px;"&gt;
If you omit the size of the array, an array just big enough to hold the initialization is created. Therefore, if you write −&lt;/div&gt;
&lt;pre class="result notranslate" style="background-color: #f1f1f1; border-radius: 0px; border: 1px solid rgb(214, 214, 214); box-sizing: border-box; color: #313131; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; overflow: auto; padding: 5px; text-align: left; width: 348px;"&gt;double balance[] = {1000.0, 2.0, 3.4, 7.0, 50.0};
&lt;/pre&gt;
&lt;div style="box-sizing: border-box; line-height: 24px; margin: 0em 0.2em 0.6em; overflow-wrap: break-word; padding: 0px;"&gt;
You will create exactly the same array as you did in the previous example. Following is an example to assign a single element of the array −&lt;/div&gt;
&lt;pre class="result notranslate" style="background-color: #f1f1f1; border-radius: 0px; border: 1px solid rgb(214, 214, 214); box-sizing: border-box; color: #313131; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; overflow: auto; padding: 5px; text-align: left; width: 348px;"&gt;balance[4] = 50.0;
&lt;/pre&gt;
&lt;div style="box-sizing: border-box; line-height: 24px; margin: 0em 0.2em 0.6em; overflow-wrap: break-word; padding: 0px;"&gt;
The above statement assigns the 5&lt;span style="box-sizing: border-box; font-size: 11.25px; line-height: 0; position: relative; top: -0.5em; vertical-align: baseline;"&gt;th&lt;/span&gt;&amp;nbsp;element in the array with a value of 50.0. All arrays have 0 as the index of their first element which is also called the base index and the last index of an array will be total size of the array minus 1. Shown below is the pictorial representation of the array we discussed above −&lt;/div&gt;
&lt;img alt="Array Presentation" src="https://www.tutorialspoint.com/cprogramming/images/array_presentation.jpg" style="border: 0px; box-sizing: border-box; color: #313131; display: block; font-size: 14px; height: inherit; margin-left: auto; margin-right: auto; max-width: 100%; padding-bottom: 4px; text-align: left; vertical-align: middle;" /&gt;&lt;br /&gt;
&lt;h2 style="box-sizing: border-box; color: #121214; font-size: 21px; font-weight: normal; left: 0px; letter-spacing: -1px; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; position: relative; text-align: left; text-shadow: rgb(204, 204, 204) 1px 1px 2px;"&gt;
Accessing Array Elements&lt;/h2&gt;
&lt;div style="box-sizing: border-box; line-height: 24px; margin: 0em 0.2em 0.6em; overflow-wrap: break-word; padding: 0px;"&gt;
An element is accessed by indexing the array name. This is done by placing the index of the element within square brackets after the name of the array. For example −&lt;/div&gt;
&lt;pre class="result notranslate" style="background-color: #f1f1f1; border-radius: 0px; border: 1px solid rgb(214, 214, 214); box-sizing: border-box; color: #313131; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; overflow: auto; padding: 5px; text-align: left; width: 348px;"&gt;double salary = balance[9];
&lt;/pre&gt;
&lt;div style="box-sizing: border-box; line-height: 24px; margin: 0em 0.2em 0.6em; overflow-wrap: break-word; padding: 0px;"&gt;
The above statement will take the 10&lt;span style="box-sizing: border-box; font-size: 11.25px; line-height: 0; position: relative; top: -0.5em; vertical-align: baseline;"&gt;th&lt;/span&gt;&amp;nbsp;element from the array and assign the value to salary variable. The following example Shows how to use all the three above mentioned concepts viz. declaration, assignment, and accessing arrays −&lt;/div&gt;
&lt;div style="box-sizing: border-box; line-height: 24px; margin: 0em 0.2em 0.6em; overflow-wrap: break-word; padding: 0px;"&gt;
&lt;pre class="prettyprint notranslate prettyprinted" style="background-color: #eeeeee; border-radius: 0px; border: 1px solid rgb(214, 214, 214); box-sizing: border-box; color: #313131; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; line-height: 16px; margin-bottom: 10px; margin-top: 15px; overflow: auto; padding: 5px; text-align: left; width: 348px;"&gt;&lt;span class="com" style="box-sizing: border-box; color: #880000;"&gt;#include&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; &lt;/span&gt;&lt;span class="str" style="box-sizing: border-box; color: #008800;"&gt;&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;
 
&lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;int&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; main &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;()&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;{&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;

   &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;int&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; n&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;[&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; &lt;/span&gt;&lt;span class="lit" style="box-sizing: border-box; color: #006666;"&gt;10&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;];&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; &lt;/span&gt;&lt;span class="com" style="box-sizing: border-box; color: #880000;"&gt;/* n is an array of 10 integers */&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;
   &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;int&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; i&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;,&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;j&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;
 
   &lt;/span&gt;&lt;span class="com" style="box-sizing: border-box; color: #880000;"&gt;/* initialize elements of array n to 0 */&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;         
   &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;for&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;(&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; i &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;=&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; &lt;/span&gt;&lt;span class="lit" style="box-sizing: border-box; color: #006666;"&gt;0&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; i &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;&amp;lt;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; &lt;/span&gt;&lt;span class="lit" style="box-sizing: border-box; color: #006666;"&gt;10&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; i&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;++&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;)&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;{&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;
      n&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;[&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; i &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;]&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;=&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; i &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;+&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; &lt;/span&gt;&lt;span class="lit" style="box-sizing: border-box; color: #006666;"&gt;100&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; &lt;/span&gt;&lt;span class="com" style="box-sizing: border-box; color: #880000;"&gt;/* set element at location i to i + 100 */&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;
   &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;}&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;
   
   &lt;/span&gt;&lt;span class="com" style="box-sizing: border-box; color: #880000;"&gt;/* output each array element's value */&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;
   &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;for&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;(&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;j &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;=&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; &lt;/span&gt;&lt;span class="lit" style="box-sizing: border-box; color: #006666;"&gt;0&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; j &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;&amp;lt;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; &lt;/span&gt;&lt;span class="lit" style="box-sizing: border-box; color: #006666;"&gt;10&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; j&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;++&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;)&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;{&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;
      printf&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;(&lt;/span&gt;&lt;span class="str" style="box-sizing: border-box; color: #008800;"&gt;"Element[%d] = %d\n"&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;,&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; j&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;,&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; n&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;[&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;j&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;]&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;);&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;
   &lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;}&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;
 
   &lt;/span&gt;&lt;span class="kwd" style="box-sizing: border-box; color: #000088;"&gt;return&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt; &lt;/span&gt;&lt;span class="lit" style="box-sizing: border-box; color: #006666;"&gt;0&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;;&lt;/span&gt;&lt;span class="pln" style="box-sizing: border-box;"&gt;
&lt;/span&gt;&lt;span class="pun" style="box-sizing: border-box; color: #666600;"&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;div style="box-sizing: border-box; line-height: 24px; margin: 0em 0.2em 0.6em; overflow-wrap: break-word; padding: 0px;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="box-sizing: border-box; line-height: 24px; margin: 0em 0.2em 0.6em; overflow-wrap: break-word; padding: 0px;"&gt;
When the above code is compiled and executed, it produces the following result −&lt;/div&gt;
&lt;pre class="result notranslate" style="background-color: #f1f1f1; border-radius: 0px; border: 1px solid rgb(214, 214, 214); box-sizing: border-box; color: #313131; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; overflow: auto; padding: 5px; text-align: left; width: 348px;"&gt;Element[0] = 100
Element[1] = 101
Element[2] = 102
Element[3] = 103
Element[4] = 104
Element[5] = 105
Element[6] = 106
Element[7] = 107
Element[8] = 108
Element[9] = 109&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</description><link>https://tweetprogrammer.blogspot.com/2019/05/array-in-c-language.html</link><author>noreply@blogger.com (Mohammad Saquib Khan)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUCv0C2F_tB-ib0hvqBCJxgl0bkuxAc3rGUyKlZJ5bqaKyysB3JsQgIuWR6DI2OwclqUdeTTOvQSQ2PUh3dod9IlxSvwUytY58pcVrsW7hDo-pZxmPipduzNtZteBFHLSpyHbq_yjDD3WH/s72-c/Logo-1558759360786.png" width="72"/><thr:total>0</thr:total><georss:featurename>UPSIDC Industrial Area, Naini, Prayagraj, Uttar Pradesh 211009, India</georss:featurename><georss:point>25.3431443 81.910167099999967</georss:point><georss:box>-3.0667557000000016 40.601573099999968 53.7530443 123.21876109999997</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7867323827570382405.post-2277384864583694393</guid><pubDate>Wed, 17 Apr 2019 19:41:00 +0000</pubDate><atom:updated>2019-04-17T12:41:12.107-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Factorial</category><category domain="http://www.blogger.com/atom/ns#">Find</category><category domain="http://www.blogger.com/atom/ns#">program</category><category domain="http://www.blogger.com/atom/ns#">Recurrsion</category><title>Program no: 7(C) C program to find Factorial of a Number using Reccursion</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;b&gt;C program to find the factorial using recurrsion&lt;/b&gt;&lt;br /&gt;
&lt;div style="-webkit-font-smoothing: antialiased; background-color: white; box-sizing: border-box; color: #121213; font-family: &amp;quot;Source Sans Pro&amp;quot;, Helvetica, sans-serif; font-size: 16px; overflow-x: hidden; text-align: justify;"&gt;
Write a recursive function in C to find factorial of a number. How to find factorial of a number using recursion in C program. Logic to find factorial of a number using recursion in C programming&lt;/div&gt;
&lt;div class="program-example note" style="-webkit-font-smoothing: antialiased; background-color: white; border-left: 5px solid rgb(167, 167, 167); border-radius: 4px; box-shadow: rgb(245, 243, 243) 1px 3px 10px; box-sizing: border-box; clear: both; color: #121213; font-family: &amp;quot;Source Sans Pro&amp;quot;, Helvetica, sans-serif; font-size: 16px; margin: 30px 0px; padding: 10px 10px 10px 20px; text-align: justify;"&gt;
&lt;div style="-webkit-font-smoothing: antialiased; box-sizing: border-box; overflow-x: hidden;"&gt;
&lt;span style="-webkit-font-smoothing: antialiased; box-sizing: border-box; font-weight: 700;"&gt;Example&lt;/span&gt;&lt;/div&gt;
&lt;div style="-webkit-font-smoothing: antialiased; box-sizing: border-box; overflow-x: hidden;"&gt;
&lt;span style="-webkit-font-smoothing: antialiased; box-sizing: border-box; font-weight: 700;"&gt;Input&lt;/span&gt;&lt;/div&gt;
&lt;pre style="-webkit-font-smoothing: antialiased; background: 0px 0px; box-sizing: border-box; color: black; font-family: Consolas, monospace; font-size: 14px; hyphens: none; overflow-wrap: break-word; overflow: auto; padding: 0px 0px 0px 10px; white-space: pre-wrap;"&gt;Input any number: 5&lt;/pre&gt;
&lt;div style="-webkit-font-smoothing: antialiased; box-sizing: border-box; overflow-x: hidden;"&gt;
&lt;span style="-webkit-font-smoothing: antialiased; box-sizing: border-box; font-weight: 700;"&gt;Output&lt;/span&gt;&lt;/div&gt;
&lt;pre style="-webkit-font-smoothing: antialiased; background: 0px 0px; box-sizing: border-box; color: black; font-family: Consolas, monospace; font-size: 14px; hyphens: none; overflow-wrap: break-word; overflow: auto; padding: 0px 0px 0px 10px; white-space: pre-wrap;"&gt;Factorial of 5 = 120&lt;/pre&gt;
&lt;/div&gt;
&lt;div style="-webkit-font-smoothing: antialiased; background-color: white; box-sizing: border-box; color: #121213; font-family: &amp;quot;Source Sans Pro&amp;quot;, Helvetica, sans-serif; font-size: 16px; overflow-x: hidden; text-align: justify;"&gt;
&lt;span style="font-family: Bitter, Georgia, serif; font-size: 26px; text-align: left;"&gt;&lt;b&gt;Required knowledge&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="-webkit-font-smoothing: antialiased; background-color: white; box-sizing: border-box; color: #121213; font-family: &amp;quot;Source Sans Pro&amp;quot;, Helvetica, sans-serif; font-size: 16px; overflow-x: hidden; text-align: justify;"&gt;
&lt;b&gt;&lt;a href="https://codeforwin.org/2015/05/basic-programming-practice-problems.html" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; color: #0054d4; text-decoration-line: none;"&gt;Basic C programming&lt;/a&gt;,&amp;nbsp;&lt;a href="https://codeforwin.org/2017/08/if-else-statement-c.html" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; color: #0054d4; text-decoration-line: none;"&gt;If else&lt;/a&gt;,&amp;nbsp;&lt;a href="https://codeforwin.org/2017/09/functions-c-programming.html" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; color: #0054d4; text-decoration-line: none;"&gt;Functions&lt;/a&gt;,&amp;nbsp;&lt;a href="https://codeforwin.org/2017/09/recursion-c-programming.html" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; color: #0054d4; text-decoration-line: none;"&gt;Recursion&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;
&lt;ol style="-webkit-font-smoothing: antialiased; background-color: white; box-sizing: border-box; color: #121213; font-family: &amp;quot;Source Sans Pro&amp;quot;, Helvetica, sans-serif; font-size: 16px; margin: 16px 0px; padding: 0px 0px 0px 40px; text-align: justify;"&gt;
&lt;li style="-webkit-font-smoothing: antialiased; box-sizing: border-box; margin: 5px 0px;"&gt;&lt;b&gt;First let us give a meaningful name to our function, say&amp;nbsp;&lt;code style="-webkit-font-smoothing: antialiased; background-color: #eaeaea; border-radius: 1px; box-sizing: border-box; display: inline-block; font-family: Consolas, monospace; font-size: 14.4px; hyphens: none; margin: 3px; padding: 0px 4px;"&gt;fact()&lt;/code&gt;.&lt;/b&gt;&lt;/li&gt;
&lt;li style="-webkit-font-smoothing: antialiased; box-sizing: border-box; margin: 5px 0px;"&gt;&lt;b&gt;The factorial function accepts an integer input whose factorial is to be calculated. Hence the function declaration should look like&amp;nbsp;&lt;code style="-webkit-font-smoothing: antialiased; background-color: #eaeaea; border-radius: 1px; box-sizing: border-box; display: inline-block; font-family: Consolas, monospace; font-size: 14.4px; hyphens: none; margin: 3px; padding: 0px 4px;"&gt;fact(int num);&lt;/code&gt;.&lt;/b&gt;&lt;/li&gt;
&lt;li style="-webkit-font-smoothing: antialiased; box-sizing: border-box; margin: 5px 0px;"&gt;&lt;b&gt;The function returns factorial as an integer value. Since, factorial can grow rapidly hence the suitable return type for this function is&amp;nbsp;&lt;code style="-webkit-font-smoothing: antialiased; background-color: #eaeaea; border-radius: 1px; box-sizing: border-box; display: inline-block; font-family: Consolas, monospace; font-size: 14.4px; hyphens: none; margin: 3px; padding: 0px 4px;"&gt;unsigned long long&lt;/code&gt;.&lt;img alt="Recursive function to find factorial" class="size-full wp-image-1627" height="77" sizes="(max-width: 337px) 100vw, 337px" src="https://codeforwin.org/wp-content/uploads/2016/02/recursive-function-to-find-factorial.png" srcset="https://codeforwin.org/wp-content/uploads/2016/02/recursive-function-to-find-factorial.png 337w, https://codeforwin.org/wp-content/uploads/2016/02/recursive-function-to-find-factorial-300x69.png 300w" style="-webkit-font-smoothing: antialiased; border: 0px; box-sizing: border-box; height: auto; max-width: 100%; vertical-align: middle;" width="337" /&gt;&lt;/b&gt;&lt;div style="-webkit-font-smoothing: antialiased; box-sizing: border-box; overflow-x: hidden;"&gt;
&lt;b&gt;&lt;span class="ezoic-adpicker-ad" id="ezoic-pub-ad-placeholder-114" style="-webkit-font-smoothing: antialiased; box-sizing: border-box;"&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style="-webkit-font-smoothing: antialiased; box-sizing: border-box; overflow-x: hidden;"&gt;
&lt;b&gt;The above mathematical function defines a recursive approach to find factorial of a number.&lt;br style="-webkit-font-smoothing: antialiased; box-sizing: border-box;" /&gt;Factorial of&amp;nbsp;&lt;samp style="-webkit-font-smoothing: antialiased; background-color: #eaeaea; border-radius: 1px; box-sizing: border-box; display: inline-block; font-family: Consolas, monospace; font-size: 14.4px; hyphens: none; margin: 3px; padding: 0px 4px;"&gt;0&lt;/samp&gt;&amp;nbsp;is&amp;nbsp;&lt;samp style="-webkit-font-smoothing: antialiased; background-color: #eaeaea; border-radius: 1px; box-sizing: border-box; display: inline-block; font-family: Consolas, monospace; font-size: 14.4px; hyphens: none; margin: 3px; padding: 0px 4px;"&gt;1&lt;/samp&gt;&amp;nbsp;which is our base condition i.e.&amp;nbsp;&lt;code style="-webkit-font-smoothing: antialiased; background-color: #eaeaea; border-radius: 1px; box-sizing: border-box; display: inline-block; font-family: Consolas, monospace; font-size: 14.4px; hyphens: none; margin: 3px; padding: 0px 4px;"&gt;if(num == 0) return 1;&lt;/code&gt;. If number is positive then return product of&amp;nbsp;&lt;var style="-webkit-font-smoothing: antialiased; background-color: #eaeaea; border-radius: 1px; box-sizing: border-box; display: inline-block; font-family: Consolas, monospace; font-size: 14.4px; font-style: normal; margin: 3px; padding: 0px 4px;"&gt;n&lt;/var&gt;&amp;nbsp;and factorial of&amp;nbsp;&lt;code style="-webkit-font-smoothing: antialiased; background-color: #eaeaea; border-radius: 1px; box-sizing: border-box; display: inline-block; font-family: Consolas, monospace; font-size: 14.4px; hyphens: none; margin: 3px; padding: 0px 4px;"&gt;n-1&lt;/code&gt;. To find factorial of&amp;nbsp;&lt;code style="-webkit-font-smoothing: antialiased; background-color: #eaeaea; border-radius: 1px; box-sizing: border-box; display: inline-block; font-family: Consolas, monospace; font-size: 14.4px; hyphens: none; margin: 3px; padding: 0px 4px;"&gt;n-1&lt;/code&gt;&amp;nbsp;we make a recursive function call to our factorial function i.e.&amp;nbsp;&lt;code style="-webkit-font-smoothing: antialiased; background-color: #eaeaea; border-radius: 1px; box-sizing: border-box; display: inline-block; font-family: Consolas, monospace; font-size: 14.4px; hyphens: none; margin: 3px; padding: 0px 4px;"&gt;num * fact(num - 1)&lt;/code&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div style="text-align: justify;"&gt;
&lt;b style="color: #121213;"&gt;&lt;span style="font-family: inherit;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;b style="color: #121213;"&gt;&lt;span style="font-family: inherit;"&gt;Source code:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="color: #121213; font-size: x-small;"&gt;&lt;span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"&gt;Here we have the codes!!&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;pre class="prettyprint prettyprinted" style="background: rgb(238, 238, 238); border: 1px solid rgb(234, 234, 236); color: #252830; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, serif; font-size: 15px; line-height: 1.15; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-spacing: 3px;"&gt;#include&amp;lt;stdio.h&amp;gt;&lt;/pre&gt;
&lt;pre class="prettyprint prettyprinted" style="background: rgb(238, 238, 238); border: 1px solid rgb(234, 234, 236); color: #252830; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, serif; font-size: 15px; line-height: 1.15; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-spacing: 3px;"&gt;long&lt;span class="pln" style="color: black; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt; &lt;/span&gt;&lt;span class="kwd" style="color: darkblue; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;int&lt;/span&gt;&lt;span class="pln" style="color: black; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt; multiplyNumbers&lt;/span&gt;&lt;span class="pun" style="color: black; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;(&lt;/span&gt;&lt;span class="kwd" style="color: darkblue; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;int&lt;/span&gt;&lt;span class="pln" style="color: black; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt; n&lt;/span&gt;&lt;span class="pun" style="color: black; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;);&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="prettyprint prettyprinted" style="background: rgb(238, 238, 238); border: 1px solid rgb(234, 234, 236); color: #252830; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, serif; font-size: 15px; line-height: 1.15; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-spacing: 3px;"&gt;&lt;code style="font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;span class="kwd" style="color: darkblue;"&gt;int&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt; main&lt;/span&gt;&lt;span class="pun" style="color: black;"&gt;()&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;
&lt;/span&gt;&lt;span class="pun" style="color: black;"&gt;{&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;
    &lt;/span&gt;&lt;span class="kwd" style="color: darkblue;"&gt;int&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt; n&lt;/span&gt;&lt;span class="pun" style="color: black;"&gt;;&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;
    printf&lt;/span&gt;&lt;span class="pun" style="color: black;"&gt;(&lt;/span&gt;&lt;span class="str" style="color: maroon;"&gt;"Enter a positive integer: "&lt;/span&gt;&lt;span class="pun" style="color: black;"&gt;);&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;
    scanf&lt;/span&gt;&lt;span class="pun" style="color: black;"&gt;(&lt;/span&gt;&lt;span class="str" style="color: maroon;"&gt;"%d"&lt;/span&gt;&lt;span class="pun" style="color: black;"&gt;,&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt; &lt;/span&gt;&lt;span class="pun" style="color: black;"&gt;&amp;amp;&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;n&lt;/span&gt;&lt;span class="pun" style="color: black;"&gt;);&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;
    printf&lt;/span&gt;&lt;span class="pun" style="color: black;"&gt;(&lt;/span&gt;&lt;span class="str" style="color: maroon;"&gt;"Factorial of %d = %ld"&lt;/span&gt;&lt;span class="pun" style="color: black;"&gt;,&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt; n&lt;/span&gt;&lt;span class="pun" style="color: black;"&gt;,&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt; multiplyNumbers&lt;/span&gt;&lt;span class="pun" style="color: black;"&gt;(&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;n&lt;/span&gt;&lt;span class="pun" style="color: black;"&gt;));&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;
    &lt;/span&gt;&lt;span class="kwd" style="color: darkblue;"&gt;return&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt; &lt;/span&gt;&lt;span class="lit" style="color: maroon;"&gt;0&lt;/span&gt;&lt;span class="pun" style="color: black;"&gt;;&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;
&lt;/span&gt;&lt;span class="pun" style="color: black;"&gt;}&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;
&lt;/span&gt;&lt;span class="kwd" style="color: darkblue;"&gt;long&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt; &lt;/span&gt;&lt;span class="kwd" style="color: darkblue;"&gt;int&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt; multiplyNumbers&lt;/span&gt;&lt;span class="pun" style="color: black;"&gt;(&lt;/span&gt;&lt;span class="kwd" style="color: darkblue;"&gt;int&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt; n&lt;/span&gt;&lt;span class="pun" style="color: black;"&gt;)&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;
&lt;/span&gt;&lt;span class="pun" style="color: black;"&gt;{&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;
    &lt;/span&gt;&lt;span class="kwd" style="color: darkblue;"&gt;if&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt; &lt;/span&gt;&lt;span class="pun" style="color: black;"&gt;(&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;n &lt;/span&gt;&lt;span class="pun" style="color: black;"&gt;&amp;gt;=&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt; &lt;/span&gt;&lt;span class="lit" style="color: maroon;"&gt;1&lt;/span&gt;&lt;span class="pun" style="color: black;"&gt;)&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;
        &lt;/span&gt;&lt;span class="kwd" style="color: darkblue;"&gt;return&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt; n&lt;/span&gt;&lt;span class="pun" style="color: black;"&gt;*&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;multiplyNumbers&lt;/span&gt;&lt;span class="pun" style="color: black;"&gt;(&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;n&lt;/span&gt;&lt;span class="pun" style="color: black;"&gt;-&lt;/span&gt;&lt;span class="lit" style="color: maroon;"&gt;1&lt;/span&gt;&lt;span class="pun" style="color: black;"&gt;);&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;
    &lt;/span&gt;&lt;span class="kwd" style="color: darkblue;"&gt;else&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;
        &lt;/span&gt;&lt;span class="kwd" style="color: darkblue;"&gt;return&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt; &lt;/span&gt;&lt;span class="lit" style="color: maroon;"&gt;1&lt;/span&gt;&lt;span class="pun" style="color: black;"&gt;;&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;
&lt;/span&gt;&lt;span class="pun" style="color: black;"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="color: #121213; font-family: Consolas, monospace;"&gt;&lt;span style="font-size: 14.4px;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="color: #121213; font-family: Consolas, monospace;"&gt;&lt;span style="font-size: 14.4px;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</description><link>https://tweetprogrammer.blogspot.com/2019/04/program-no-7c-c-program-to-find.html</link><author>noreply@blogger.com (Mohammad Saquib Khan)</author><thr:total>0</thr:total><georss:featurename>UPSIDC Industrial Area, Naini, Prayagraj, Uttar Pradesh 211009, India</georss:featurename><georss:point>25.3431443 81.910167099999967</georss:point><georss:box>-3.0675177 40.601573099999968 53.753806299999994 123.21876109999997</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7867323827570382405.post-4760551613198646680</guid><pubDate>Wed, 17 Apr 2019 19:25:00 +0000</pubDate><atom:updated>2019-04-17T12:26:28.830-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">c program</category><category domain="http://www.blogger.com/atom/ns#">Power</category><category domain="http://www.blogger.com/atom/ns#">Recurrsion</category><title>Program no: 7(E) C Program to Find the power of a number Using Recurrsion</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
C program to calculate the power of a number using Recurrsion&lt;br /&gt;
&lt;div&gt;
&lt;span style="background-color: white; font-family: &amp;quot;segoe ui&amp;quot; , &amp;quot;open sans&amp;quot; , sans-serif; font-size: 17px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: white; font-family: &amp;quot;segoe ui&amp;quot; , &amp;quot;open sans&amp;quot; , sans-serif; font-size: 17px;"&gt;In this program we will read base and power and then&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: white; font-family: &amp;quot;segoe ui&amp;quot; , &amp;quot;open sans&amp;quot; , sans-serif; font-size: 17px;"&gt;calculate result of that expression using recursion.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: white; font-family: &amp;quot;arial&amp;quot; , sans-serif; font-size: 15px;"&gt;Below is a program to calculate the result of a given number, raised to the power of&amp;nbsp;&lt;/span&gt;&lt;code style="background-color: #f9f2f4; border-radius: 4px; color: #c7254e; font-family: Monaco, Menlo, Consolas, &amp;quot;courier new&amp;quot;, monospace; font-size: 13.5px; padding: 2px 4px; white-space: nowrap;"&gt;n&lt;/code&gt;&lt;span style="background-color: white; font-family: &amp;quot;arial&amp;quot; , sans-serif; font-size: 15px;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: white; font-family: &amp;quot;arial&amp;quot; , sans-serif; font-size: 15px;"&gt;using recursion.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Recurrsion:&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style="background-color: white; color: #3c4043; font-family: &amp;quot;roboto&amp;quot; , &amp;quot;helveticaneue&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; font-size: 14px; max-height: 999999px;"&gt;Recursion&lt;/span&gt;&lt;span style="background-color: white; color: #3c4043; font-family: &amp;quot;roboto&amp;quot; , &amp;quot;helveticaneue&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; font-size: 14px;"&gt;&amp;nbsp;is a programming technique that allows the programmer to express operations in terms of themselves. In&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: white; color: #3c4043; font-family: &amp;quot;roboto&amp;quot; , &amp;quot;helveticaneue&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; font-size: 14px; max-height: 999999px;"&gt;C&lt;/span&gt;&lt;span style="background-color: white; color: #3c4043; font-family: &amp;quot;roboto&amp;quot; , &amp;quot;helveticaneue&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; font-size: 14px;"&gt;, this takes the form of a function that calls itself. A useful way to think of&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: white; color: #3c4043; font-family: &amp;quot;roboto&amp;quot; , &amp;quot;helveticaneue&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; font-size: 14px; max-height: 999999px;"&gt;recursive&lt;/span&gt;&lt;span style="background-color: white; color: #3c4043; font-family: &amp;quot;roboto&amp;quot; , &amp;quot;helveticaneue&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; font-size: 14px;"&gt;&amp;nbsp;functions is to imagine them as a process being performed where one of the instructions is to "repeat the process".&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Source Code:&lt;/div&gt;
&lt;div&gt;
&lt;pre class="c language-clike" style="background: rgb(30, 42, 55); border-radius: 0.3em; color: #f8f8f2; font-family: Consolas, Monaco, &amp;quot;andale mono&amp;quot;, &amp;quot;ubuntu mono&amp;quot;, monospace; font-size: 11px; hyphens: none; line-height: 1.5; margin-bottom: 0.5em; margin-top: 0.5em; overflow-wrap: normal; overflow: auto; padding: 1em; tab-size: 4; text-shadow: rgba(0, 0, 0, 0.3) 0px 1px; word-break: normal;"&gt;&lt;code class=" language-clike" style="background: 0px 0px; border-radius: 0px; font-family: Consolas, Monaco, &amp;quot;andale mono&amp;quot;, &amp;quot;ubuntu mono&amp;quot;, monospace; font-size: inherit; hyphens: none; line-height: 1.5; overflow-wrap: normal; padding: 0px; tab-size: 4; text-shadow: rgba(0, 0, 0, 0.3) 0px 1px; word-break: normal; word-spacing: normal;"&gt;#include&lt;span class="token operator"&gt;&amp;lt;&lt;/span&gt;stdio&lt;span class="token punctuation"&gt;.&lt;/span&gt;h

&lt;span class="token comment" spellcheck="true" style="color: slategrey;"&gt;// function prototype declaration&lt;/span&gt;
int &lt;span class="token function" style="color: #e6db74;"&gt;power&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;int n1&lt;span class="token punctuation"&gt;,&lt;/span&gt; int n2&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;

int &lt;span class="token function" style="color: #e6db74;"&gt;main&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;
&lt;span class="token punctuation"&gt;{&lt;/span&gt;
    int base&lt;span class="token punctuation"&gt;,&lt;/span&gt; exp&lt;span class="token punctuation"&gt;;&lt;/span&gt;
    &lt;span class="token function" style="color: #e6db74;"&gt;printf&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string" style="color: #a6e22e;"&gt;"Enter base number: "&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
    &lt;span class="token function" style="color: #e6db74;"&gt;scanf&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string" style="color: #a6e22e;"&gt;"%d"&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt; &lt;span class="token operator"&gt;&amp;amp;&lt;/span&gt;base&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
    &lt;span class="token function" style="color: #e6db74;"&gt;printf&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string" style="color: #a6e22e;"&gt;"\n\nEnter Power factor: "&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
    &lt;span class="token function" style="color: #e6db74;"&gt;scanf&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string" style="color: #a6e22e;"&gt;"%d"&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt; &lt;span class="token operator"&gt;&amp;amp;&lt;/span&gt;exp&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
    &lt;span class="token function" style="color: #e6db74;"&gt;printf&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;&lt;span class="token string" style="color: #a6e22e;"&gt;"\n\n\n\t\t\t%d^%d = %d"&lt;/span&gt;&lt;span class="token punctuation"&gt;,&lt;/span&gt; base&lt;span class="token punctuation"&gt;,&lt;/span&gt; exp&lt;span class="token punctuation"&gt;,&lt;/span&gt; &lt;span class="token function" style="color: #e6db74;"&gt;power&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;base&lt;span class="token punctuation"&gt;,&lt;/span&gt; exp&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
    &lt;span class="token keyword" style="color: #66d9ef;"&gt;return&lt;/span&gt; &lt;span class="token number" style="color: #ae81ff;"&gt;0&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
&lt;span class="token punctuation"&gt;}&lt;/span&gt;

int &lt;span class="token function" style="color: #e6db74;"&gt;power&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;int b&lt;span class="token punctuation"&gt;,&lt;/span&gt; int e&lt;span class="token punctuation"&gt;)&lt;/span&gt;
&lt;span class="token punctuation"&gt;{&lt;/span&gt;
    &lt;span class="token keyword" style="color: #66d9ef;"&gt;if&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;e &lt;span class="token operator"&gt;==&lt;/span&gt; &lt;span class="token number" style="color: #ae81ff;"&gt;0&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;
        &lt;span class="token keyword" style="color: #66d9ef;"&gt;return&lt;/span&gt; &lt;span class="token number" style="color: #ae81ff;"&gt;1&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;

    &lt;span class="token keyword" style="color: #66d9ef;"&gt;return&lt;/span&gt; &lt;span class="token punctuation"&gt;(&lt;/span&gt;b&lt;span class="token operator"&gt;*&lt;/span&gt;&lt;span class="token function" style="color: #e6db74;"&gt;power&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;b&lt;span class="token punctuation"&gt;,&lt;/span&gt; e&lt;span class="token number" style="color: #ae81ff;"&gt;-1&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
&lt;span class="token punctuation"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
</description><link>https://tweetprogrammer.blogspot.com/2019/04/program-no-7e-c-program-to-find-power.html</link><author>noreply@blogger.com (Mohammad Saquib Khan)</author><thr:total>0</thr:total><georss:featurename>UPSIDC Industrial Area, Naini, Prayagraj, Uttar Pradesh 211009, India</georss:featurename><georss:point>25.3431443 81.910167099999967</georss:point><georss:box>-3.0675177 40.601573099999968 53.753806299999994 123.21876109999997</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7867323827570382405.post-4485782827905679068</guid><pubDate>Wed, 17 Apr 2019 19:12:00 +0000</pubDate><atom:updated>2019-04-17T12:15:00.677-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">array</category><category domain="http://www.blogger.com/atom/ns#">Binary search</category><category domain="http://www.blogger.com/atom/ns#">c program</category><category domain="http://www.blogger.com/atom/ns#">searching</category><title>Program no: 8(D) C Program for Binary Searching in an Array</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
C program for Binary Searching in an Array&lt;br /&gt;
&lt;h2 style="background-color: white; color: green; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 17.12px;"&gt;
Binary Search in C&lt;/h2&gt;
&lt;div style="background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 25px;"&gt;
To perform binary search in C programming, you have to ask to the user to enter the array size then ask to enter the array elements. Now ask to enter an element to be search, to start searching that element using binary search technique&lt;/div&gt;
&lt;h2 style="background-color: white; color: green; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 17.12px;"&gt;
C Programming Code for Binary Search&lt;/h2&gt;
&lt;div style="background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 25px;"&gt;
Following C program first ask to the user to enter "how many element he/she want to store in the array", then ask to enter the array element one by one". After storing the element in the array, program ask to enter the element which he/she want to search in the array whether the number/element is present or not in the given array. The searching technique used here is binary search which is fast technique:&lt;/div&gt;
&lt;div style="background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 25px;"&gt;
&lt;span style="color: green; font-size: 17.12px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 25px;"&gt;
&lt;span style="color: green; font-size: 17.12px;"&gt;&lt;b&gt;Source Code:&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr"&gt;
&lt;span style="font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: x-small;"&gt;/*&lt;br /&gt;
Summary: Binary search compares the search value with the value of the middle element of the array. If they match, then a matching element has been found and its position is returned. Otherwise, if the search value is less than the middle element's value, then the algorithm repeats its action on the sub-array to the left of the middle element or, if the search value is greater, on the sub-array to the right.&lt;br /&gt;
Complexity - O(log n)&lt;br /&gt;
*/&lt;/span&gt;&lt;/div&gt;
&lt;table class="crayon-table" style="background-attachment: initial !important; background-clip: initial !important; background-color: whitesmoke; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-collapse: collapse !important; border-spacing: 0px !important; border: none !important; color: #444444; font-family: Monaco, MonacoRegular, &amp;quot;Courier New&amp;quot;, monospace; font-size: 14px; line-height: 2; margin-bottom: 0px !important; margin-left: -27px; margin-right: 0px !important; margin-top: 0px !important; padding: 0px !important; table-layout: auto !important; vertical-align: baseline; width: auto !important;"&gt;&lt;tbody style="border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;
&lt;tr class="crayon-row" style="background: 0px center; border: none !important; margin: 0px !important; padding: 0px !important; vertical-align: top !important;"&gt;&lt;td class="crayon-nums " data-settings="hide" style="background-attachment: initial; background-clip: initial; background-color: rgb(238, 238, 238) !important; background-image: initial; background-origin: initial; background-position: 0px center; background-repeat: initial; background-size: initial; border: 0px; margin: 0px !important; padding: 0px !important; vertical-align: top !important;"&gt;&lt;div class="crayon-nums-content" style="background: 0px center; border: 0px; font-size: 12px !important; line-height: 15px !important; margin: 0px; padding-bottom: 3px !important; padding-left: 0px; padding-right: 0px; padding-top: 5px !important; vertical-align: baseline; white-space: nowrap;"&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-1" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
1&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-2" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
2&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-3" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
3&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-4" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
4&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-5" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
5&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-6" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
6&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-7" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
7&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-8" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
8&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-9" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
9&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-10" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
10&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-11" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
11&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-12" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
12&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-13" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
13&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-14" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
14&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-15" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
15&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-16" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
16&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-17" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
17&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-18" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
18&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-19" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
19&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-20" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
20&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-21" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
21&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-22" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
22&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-23" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
23&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-24" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
24&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-25" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
25&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-26" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
26&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-27" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
27&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-28" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
28&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-29" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
29&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-30" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
30&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-31" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
31&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-32" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
32&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-33" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
33&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-34" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
34&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-35" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
35&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-36" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
36&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-37" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
37&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-38" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
38&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-39" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
39&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-40" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
40&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5cb7742b278d4538126885-41" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 1px solid rgb(222, 222, 222) !important; border-top: 0px; color: rgb(170, 170, 170) !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; min-width: 1.2em !important; padding: 0px 5px; text-align: right !important; vertical-align: baseline;"&gt;
41&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;td class="crayon-code" style="background: 0px center; border: 0px; margin: 0px !important; padding: 0px !important; vertical-align: top !important; width: 310.667px;"&gt;&lt;div class="crayon-pre" style="background: none !important; border: none !important; color: black; font-size: 12px !important; line-height: 15px !important; margin: 0px; overflow: visible; padding-bottom: 3px !important; padding-left: 0px; padding-right: 0px; padding-top: 5px !important; tab-size: 4; vertical-align: baseline; white-space: pre;"&gt;
&lt;div class="crayon-line" id="crayon-5cb7742b278d4538126885-1" style="background: 0px center; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; vertical-align: baseline;"&gt;
&lt;span class="crayon-p" style="border: 0px; color: rgb(184 , 92 , 0); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;#include&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="crayon-line" id="crayon-5cb7742b278d4538126885-2" style="background: 0px center; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; vertical-align: baseline;"&gt;
&amp;nbsp;&lt;span class="crayon-t" style="background-color: initial; border: 0px; color: rgb(25 , 144 , 197); font-family: inherit; font-size: inherit; font-weight: bold; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;int&lt;/span&gt;&lt;span class="crayon-h" style="background-color: initial; border: 0px; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt; &lt;/span&gt;&lt;span class="crayon-e" style="background-color: initial; border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;main&lt;/span&gt;&lt;span class="crayon-sy" style="background-color: initial; border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;(&lt;/span&gt;&lt;span class="crayon-sy" style="background-color: initial; border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div class="crayon-line" id="crayon-5cb7742b278d4538126885-4" style="background: 0px center; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; vertical-align: baseline;"&gt;
&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class="crayon-line" id="crayon-5cb7742b278d4538126885-5" style="background: 0px center; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; vertical-align: baseline;"&gt;
&lt;span class="crayon-h" style="border: 0px; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="crayon-t" style="border: 0px; color: rgb(25 , 144 , 197); font-family: inherit; font-size: inherit; font-weight: bold; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;int&lt;/span&gt;&lt;span class="crayon-h" style="border: 0px; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt; &lt;/span&gt;&lt;span class="crayon-v" style="border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;arr&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;[&lt;/span&gt;&lt;span class="crayon-cn" style="border: 0px; color: rgb(153 , 0 , 85); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;50&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;]&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;,&lt;/span&gt;&lt;span class="crayon-v" style="border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;i&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;,&lt;/span&gt;&lt;span class="crayon-v" style="border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;n&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;,&lt;/span&gt;&lt;span class="crayon-v" style="border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;x&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;,&lt;/span&gt;&lt;span class="crayon-v" style="border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;flag&lt;/span&gt;&lt;span class="crayon-o" style="border: 0px; color: rgb(166 , 127 , 89); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;=&lt;/span&gt;&lt;span class="crayon-cn" style="border: 0px; color: rgb(153 , 0 , 85); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;0&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;,&lt;/span&gt;&lt;span class="crayon-v" style="border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;first&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;,&lt;/span&gt;&lt;span class="crayon-v" style="border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;last&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;,&lt;/span&gt;&lt;span class="crayon-v" style="border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;mid&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class="crayon-line" id="crayon-5cb7742b278d4538126885-6" style="background: 0px center; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; vertical-align: baseline;"&gt;
&amp;nbsp;&lt;span class="crayon-h" style="background-color: initial; border: 0px; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="crayon-r" style="background-color: initial; border: 0px; color: rgb(25 , 144 , 197); font-family: inherit; font-size: inherit; font-weight: bold; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;printf&lt;/span&gt;&lt;span class="crayon-sy" style="background-color: initial; border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;(&lt;/span&gt;&lt;span class="crayon-s" style="background-color: initial; border: 0px; color: rgb(102 , 153 , 0); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;"Enter size of array:"&lt;/span&gt;&lt;span class="crayon-sy" style="background-color: initial; border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;)&lt;/span&gt;&lt;span class="crayon-sy" style="background-color: initial; border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class="crayon-line" id="crayon-5cb7742b278d4538126885-8" style="background: 0px center; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; vertical-align: baseline;"&gt;
&lt;span class="crayon-h" style="border: 0px; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="crayon-e" style="border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;scanf&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;(&lt;/span&gt;&lt;span class="crayon-s" style="border: 0px; color: rgb(102 , 153 , 0); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;"%d"&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;,&lt;/span&gt;&lt;span class="crayon-o" style="border: 0px; color: rgb(166 , 127 , 89); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;&amp;amp;&lt;/span&gt;&lt;span class="crayon-v" style="border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;n&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;)&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class="crayon-line" id="crayon-5cb7742b278d4538126885-9" style="background: 0px center; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; vertical-align: baseline;"&gt;
&lt;span class="crayon-h" style="border: 0px; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="crayon-r" style="border: 0px; color: rgb(25 , 144 , 197); font-family: inherit; font-size: inherit; font-weight: bold; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;printf&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;(&lt;/span&gt;&lt;span class="crayon-s" style="border: 0px; color: rgb(102 , 153 , 0); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;"\nEnter array element(ascending order)\n"&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;)&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class="crayon-line" id="crayon-5cb7742b278d4538126885-10" style="background: 0px center; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; vertical-align: baseline;"&gt;
&amp;nbsp;&lt;span class="crayon-h" style="background-color: initial; border: 0px; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="crayon-st" style="background-color: initial; border: 0px; color: rgb(25 , 144 , 197); font-family: inherit; font-size: inherit; font-weight: bold; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;for&lt;/span&gt;&lt;span class="crayon-sy" style="background-color: initial; border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;(&lt;/span&gt;&lt;span class="crayon-v" style="background-color: initial; border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;i&lt;/span&gt;&lt;span class="crayon-o" style="background-color: initial; border: 0px; color: rgb(166 , 127 , 89); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;=&lt;/span&gt;&lt;span class="crayon-cn" style="background-color: initial; border: 0px; color: rgb(153 , 0 , 85); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;0&lt;/span&gt;&lt;span class="crayon-sy" style="background-color: initial; border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;span class="crayon-v" style="background-color: initial; border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;i&lt;/span&gt;&lt;span class="crayon-o" style="background-color: initial; border: 0px; color: rgb(166 , 127 , 89); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;&amp;lt;&lt;/span&gt;&lt;span class="crayon-v" style="background-color: initial; border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;n&lt;/span&gt;&lt;span class="crayon-sy" style="background-color: initial; border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;span class="crayon-o" style="background-color: initial; border: 0px; color: rgb(166 , 127 , 89); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;++&lt;/span&gt;&lt;span class="crayon-v" style="background-color: initial; border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;i&lt;/span&gt;&lt;span class="crayon-sy" style="background-color: initial; border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div class="crayon-line" id="crayon-5cb7742b278d4538126885-12" style="background: 0px center; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; vertical-align: baseline;"&gt;
&lt;span class="crayon-h" style="border: 0px; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="crayon-e" style="border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;scanf&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;(&lt;/span&gt;&lt;span class="crayon-s" style="border: 0px; color: rgb(102 , 153 , 0); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;"%d"&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;,&lt;/span&gt;&lt;span class="crayon-o" style="border: 0px; color: rgb(166 , 127 , 89); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;&amp;amp;&lt;/span&gt;&lt;span class="crayon-v" style="border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;arr&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;[&lt;/span&gt;&lt;span class="crayon-v" style="border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;i&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;]&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;)&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class="crayon-line" id="crayon-5cb7742b278d4538126885-13" style="background: 0px center; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; vertical-align: baseline;"&gt;
&amp;nbsp;  &lt;span class="crayon-h" style="background-color: initial; border: 0px; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="crayon-r" style="background-color: initial; border: 0px; color: rgb(25 , 144 , 197); font-family: inherit; font-size: inherit; font-weight: bold; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;printf&lt;/span&gt;&lt;span class="crayon-sy" style="background-color: initial; border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;(&lt;/span&gt;&lt;span class="crayon-s" style="background-color: initial; border: 0px; color: rgb(102 , 153 , 0); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;"\nEnter the element to search:"&lt;/span&gt;&lt;span class="crayon-sy" style="background-color: initial; border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;)&lt;/span&gt;&lt;span class="crayon-sy" style="background-color: initial; border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class="crayon-line" id="crayon-5cb7742b278d4538126885-15" style="background: 0px center; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; vertical-align: baseline;"&gt;
&lt;span class="crayon-h" style="border: 0px; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="crayon-e" style="border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;scanf&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;(&lt;/span&gt;&lt;span class="crayon-s" style="border: 0px; color: rgb(102 , 153 , 0); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;"%d"&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;,&lt;/span&gt;&lt;span class="crayon-o" style="border: 0px; color: rgb(166 , 127 , 89); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;&amp;amp;&lt;/span&gt;&lt;span class="crayon-v" style="border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;x&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;)&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class="crayon-line" id="crayon-5cb7742b278d4538126885-16" style="background: 0px center; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; vertical-align: baseline;"&gt;
&amp;nbsp;   &lt;span class="crayon-h" style="background-color: initial; border: 0px; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="crayon-v" style="background-color: initial; border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;first&lt;/span&gt;&lt;span class="crayon-o" style="background-color: initial; border: 0px; color: rgb(166 , 127 , 89); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;=&lt;/span&gt;&lt;span class="crayon-cn" style="background-color: initial; border: 0px; color: rgb(153 , 0 , 85); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;0&lt;/span&gt;&lt;span class="crayon-sy" style="background-color: initial; border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class="crayon-line" id="crayon-5cb7742b278d4538126885-18" style="background: 0px center; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; vertical-align: baseline;"&gt;
&lt;span class="crayon-h" style="border: 0px; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="crayon-v" style="border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;last&lt;/span&gt;&lt;span class="crayon-o" style="border: 0px; color: rgb(166 , 127 , 89); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;=&lt;/span&gt;&lt;span class="crayon-v" style="border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;n&lt;/span&gt;&lt;span class="crayon-o" style="border: 0px; color: rgb(166 , 127 , 89); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;-&lt;/span&gt;&lt;span class="crayon-cn" style="border: 0px; color: rgb(153 , 0 , 85); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;1&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class="crayon-line" id="crayon-5cb7742b278d4538126885-19" style="background: 0px center; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; vertical-align: baseline;"&gt;
&amp;nbsp; &lt;span class="crayon-h" style="background-color: initial; border: 0px; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="crayon-st" style="background-color: initial; border: 0px; color: rgb(25 , 144 , 197); font-family: inherit; font-size: inherit; font-weight: bold; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;while&lt;/span&gt;&lt;span class="crayon-sy" style="background-color: initial; border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;(&lt;/span&gt;&lt;span class="crayon-v" style="background-color: initial; border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;first&lt;/span&gt;&lt;span class="crayon-o" style="background-color: initial; border: 0px; color: rgb(166 , 127 , 89); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;&amp;lt;=&lt;/span&gt;&lt;span class="crayon-v" style="background-color: initial; border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;last&lt;/span&gt;&lt;span class="crayon-sy" style="background-color: initial; border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div class="crayon-line" id="crayon-5cb7742b278d4538126885-21" style="background: 0px center; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; vertical-align: baseline;"&gt;
&lt;span class="crayon-h" style="border: 0px; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class="crayon-line" id="crayon-5cb7742b278d4538126885-22" style="background: 0px center; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; vertical-align: baseline;"&gt;
&lt;span class="crayon-h" style="border: 0px; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="crayon-v" style="border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;mid&lt;/span&gt;&lt;span class="crayon-o" style="border: 0px; color: rgb(166 , 127 , 89); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;=&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;(&lt;/span&gt;&lt;span class="crayon-v" style="border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;first&lt;/span&gt;&lt;span class="crayon-o" style="border: 0px; color: rgb(166 , 127 , 89); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;+&lt;/span&gt;&lt;span class="crayon-v" style="border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;last&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;)&lt;/span&gt;&lt;span class="crayon-o" style="border: 0px; color: rgb(166 , 127 , 89); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;/&lt;/span&gt;&lt;span class="crayon-cn" style="border: 0px; color: rgb(153 , 0 , 85); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;2&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class="crayon-line" id="crayon-5cb7742b278d4538126885-23" style="background: 0px center; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; vertical-align: baseline;"&gt;
&amp;nbsp;&lt;span class="crayon-h" style="background-color: initial; border: 0px; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="crayon-st" style="background-color: initial; border: 0px; color: rgb(25 , 144 , 197); font-family: inherit; font-size: inherit; font-weight: bold; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;if&lt;/span&gt;&lt;span class="crayon-sy" style="background-color: initial; border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;(&lt;/span&gt;&lt;span class="crayon-v" style="background-color: initial; border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;x&lt;/span&gt;&lt;span class="crayon-o" style="background-color: initial; border: 0px; color: rgb(166 , 127 , 89); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;==&lt;/span&gt;&lt;span class="crayon-v" style="background-color: initial; border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;arr&lt;/span&gt;&lt;span class="crayon-sy" style="background-color: initial; border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;[&lt;/span&gt;&lt;span class="crayon-v" style="background-color: initial; border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;mid&lt;/span&gt;&lt;span class="crayon-sy" style="background-color: initial; border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;]&lt;/span&gt;&lt;span class="crayon-sy" style="background-color: initial; border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;span class="crayon-sy" style="background-color: initial; border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;   {&lt;/span&gt;&lt;/div&gt;
&lt;div class="crayon-line" id="crayon-5cb7742b278d4538126885-25" style="background: 0px center; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; vertical-align: baseline;"&gt;
&lt;span class="crayon-h" style="border: 0px; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="crayon-v" style="border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;flag&lt;/span&gt;&lt;span class="crayon-o" style="border: 0px; color: rgb(166 , 127 , 89); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;=&lt;/span&gt;&lt;span class="crayon-cn" style="border: 0px; color: rgb(153 , 0 , 85); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;1&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class="crayon-line" id="crayon-5cb7742b278d4538126885-26" style="background: 0px center; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; vertical-align: baseline;"&gt;
&lt;span class="crayon-h" style="border: 0px; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="crayon-st" style="border: 0px; color: rgb(25 , 144 , 197); font-family: inherit; font-size: inherit; font-weight: bold; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;break&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class="crayon-line" id="crayon-5cb7742b278d4538126885-27" style="background: 0px center; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; vertical-align: baseline;"&gt;
&lt;span class="crayon-h" style="border: 0px; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class="crayon-line" id="crayon-5cb7742b278d4538126885-28" style="background: 0px center; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; vertical-align: baseline;"&gt;
&lt;span class="crayon-h" style="border: 0px; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="crayon-st" style="border: 0px; color: rgb(25 , 144 , 197); font-family: inherit; font-size: inherit; font-weight: bold; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;else&lt;/span&gt;&lt;/div&gt;
&lt;div class="crayon-line" id="crayon-5cb7742b278d4538126885-29" style="background: 0px center; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; vertical-align: baseline;"&gt;
&lt;span class="crayon-h" style="border: 0px; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="crayon-st" style="border: 0px; color: rgb(25 , 144 , 197); font-family: inherit; font-size: inherit; font-weight: bold; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;if&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;(&lt;/span&gt;&lt;span class="crayon-v" style="border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;x&lt;/span&gt;&lt;span class="crayon-o" style="border: 0px; color: rgb(166 , 127 , 89); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;&amp;gt;&lt;/span&gt;&lt;span class="crayon-v" style="border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;arr&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;[&lt;/span&gt;&lt;span class="crayon-v" style="border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;mid&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;]&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div class="crayon-line" id="crayon-5cb7742b278d4538126885-30" style="background: 0px center; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; vertical-align: baseline;"&gt;
&lt;span class="crayon-h" style="border: 0px; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="crayon-v" style="border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;first&lt;/span&gt;&lt;span class="crayon-o" style="border: 0px; color: rgb(166 , 127 , 89); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;=&lt;/span&gt;&lt;span class="crayon-v" style="border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;mid&lt;/span&gt;&lt;span class="crayon-o" style="border: 0px; color: rgb(166 , 127 , 89); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;+&lt;/span&gt;&lt;span class="crayon-cn" style="border: 0px; color: rgb(153 , 0 , 85); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;1&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class="crayon-line" id="crayon-5cb7742b278d4538126885-31" style="background: 0px center; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; vertical-align: baseline;"&gt;
&lt;span class="crayon-h" style="border: 0px; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="crayon-st" style="border: 0px; color: rgb(25 , 144 , 197); font-family: inherit; font-size: inherit; font-weight: bold; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;else&lt;/span&gt;&lt;/div&gt;
&lt;div class="crayon-line" id="crayon-5cb7742b278d4538126885-32" style="background: 0px center; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; vertical-align: baseline;"&gt;
&lt;span class="crayon-h" style="border: 0px; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="crayon-v" style="border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;last&lt;/span&gt;&lt;span class="crayon-o" style="border: 0px; color: rgb(166 , 127 , 89); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;=&lt;/span&gt;&lt;span class="crayon-v" style="border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;mid&lt;/span&gt;&lt;span class="crayon-o" style="border: 0px; color: rgb(166 , 127 , 89); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;-&lt;/span&gt;&lt;span class="crayon-cn" style="border: 0px; color: rgb(153 , 0 , 85); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;1&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class="crayon-line" id="crayon-5cb7742b278d4538126885-33" style="background: 0px center; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; vertical-align: baseline;"&gt;
&lt;span class="crayon-h" style="border: 0px; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class="crayon-line" id="crayon-5cb7742b278d4538126885-34" style="background: 0px center; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; vertical-align: baseline;"&gt;
&amp;nbsp;&lt;span class="crayon-h" style="background-color: initial; border: 0px; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="crayon-st" style="background-color: initial; border: 0px; color: rgb(25 , 144 , 197); font-family: inherit; font-size: inherit; font-weight: bold; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;if&lt;/span&gt;&lt;span class="crayon-sy" style="background-color: initial; border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;(&lt;/span&gt;&lt;span class="crayon-v" style="background-color: initial; border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;flag&lt;/span&gt;&lt;span class="crayon-o" style="background-color: initial; border: 0px; color: rgb(166 , 127 , 89); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;==&lt;/span&gt;&lt;span class="crayon-cn" style="background-color: initial; border: 0px; color: rgb(153 , 0 , 85); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;1&lt;/span&gt;&lt;span class="crayon-sy" style="background-color: initial; border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div class="crayon-line" id="crayon-5cb7742b278d4538126885-36" style="background: 0px center; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; vertical-align: baseline;"&gt;
&lt;span class="crayon-h" style="border: 0px; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="crayon-r" style="border: 0px; color: rgb(25 , 144 , 197); font-family: inherit; font-size: inherit; font-weight: bold; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;printf&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;(&lt;/span&gt;&lt;span class="crayon-s" style="border: 0px; color: rgb(102 , 153 , 0); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;"\nElement found at position %d"&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;,&lt;/span&gt;&lt;span class="crayon-v" style="border: 0px; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;mid&lt;/span&gt;&lt;span class="crayon-o" style="border: 0px; color: rgb(166 , 127 , 89); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;+&lt;/span&gt;&lt;span class="crayon-cn" style="border: 0px; color: rgb(153 , 0 , 85); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;1&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;)&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class="crayon-line" id="crayon-5cb7742b278d4538126885-37" style="background: 0px center; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; vertical-align: baseline;"&gt;
&lt;span class="crayon-h" style="border: 0px; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="crayon-st" style="border: 0px; color: rgb(25 , 144 , 197); font-family: inherit; font-size: inherit; font-weight: bold; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;else&lt;/span&gt;&lt;/div&gt;
&lt;div class="crayon-line" id="crayon-5cb7742b278d4538126885-38" style="background: 0px center; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; vertical-align: baseline;"&gt;
&lt;span class="crayon-h" style="border: 0px; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="crayon-r" style="border: 0px; color: rgb(25 , 144 , 197); font-family: inherit; font-size: inherit; font-weight: bold; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;printf&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;(&lt;/span&gt;&lt;span class="crayon-s" style="border: 0px; color: rgb(102 , 153 , 0); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;"\nElement not found"&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;)&lt;/span&gt;&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class="crayon-line" id="crayon-5cb7742b278d4538126885-39" style="background: 0px center; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; vertical-align: baseline;"&gt;
&amp;nbsp;&lt;span class="crayon-h" style="background-color: initial; border: 0px; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="crayon-st" style="background-color: initial; border: 0px; color: rgb(25 , 144 , 197); font-family: inherit; font-size: inherit; font-weight: bold; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;return&lt;/span&gt;&lt;span class="crayon-h" style="background-color: initial; border: 0px; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt; &lt;/span&gt;&lt;span class="crayon-cn" style="background-color: initial; border: 0px; color: rgb(153 , 0 , 85); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;0&lt;/span&gt;&lt;span class="crayon-sy" style="background-color: initial; border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class="crayon-line" id="crayon-5cb7742b278d4538126885-41" style="background: 0px center; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; vertical-align: baseline;"&gt;
&lt;span class="crayon-sy" style="border: 0px; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
</description><link>https://tweetprogrammer.blogspot.com/2019/04/program-no-8d-c-program-for-binary.html</link><author>noreply@blogger.com (Mohammad Saquib Khan)</author><thr:total>0</thr:total><georss:featurename>UPSIDC Industrial Area, Naini, Prayagraj, Uttar Pradesh 211009, India</georss:featurename><georss:point>25.3431443 81.910167099999967</georss:point><georss:box>-3.0675177 40.601573099999968 53.753806299999994 123.21876109999997</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7867323827570382405.post-2254641883107508061</guid><pubDate>Tue, 16 Apr 2019 20:29:00 +0000</pubDate><atom:updated>2019-04-16T13:29:47.768-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">array</category><category domain="http://www.blogger.com/atom/ns#">c program</category><category domain="http://www.blogger.com/atom/ns#">Linear search</category><category domain="http://www.blogger.com/atom/ns#">searching</category><title>Program No: 8(D) C Program For Linear Searching in an Array</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;b&gt;C program for Linear search in array&lt;/b&gt;&lt;br /&gt;
&lt;span style="background-color: white; color: green; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 17.12px;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="background-color: white; color: green; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 17.12px;"&gt;&lt;b&gt;Linear Search in C&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style="background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 25px;"&gt;
To search any element present inside the array in C programming using linear search technique, you have to use only one&amp;nbsp;&lt;b&gt;for&lt;/b&gt;&amp;nbsp;loop as shown in the following program.&lt;/div&gt;
&lt;h2 style="background-color: white; color: green; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 17.12px;"&gt;
C Programming Code for Linear Search&lt;/h2&gt;
&lt;div style="background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 25px;"&gt;
Following C program first ask to the user to enter the array size then it will ask to enter the array elements, then it will finally ask to enter a number or element to be search in the given array to check whether it is present in the array or not, if it is present then at which position :&lt;/div&gt;
&lt;div style="background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 25px;"&gt;
&lt;span style="color: green; font-size: 17.12px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 25px;"&gt;
&lt;span style="color: green; font-size: 17.12px;"&gt;&lt;b&gt;Source Code:&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre style="background-color: white; color: #333333; font-size: 16px;"&gt;/* C Program - Linear Search */
  
#include&amp;lt;stdio.h&amp;gt;
#include&amp;lt;conio.h&amp;gt;
void main()
{
 clrscr();
 int arr[10], i, num, n, c=0, pos;
 printf("Enter the array size : ");
 scanf("%d",&amp;amp;n);
 printf("Enter Array Elements : ");
 for(i=0; i&amp;lt;n; i++)
 {
  scanf("%d",&amp;amp;arr[i]);
 }
 printf("Enter the number to be search : ");
 scanf("%d",&amp;amp;num);
 for(i=0; i&amp;lt;n; i++)
 {
  if(arr[i]==num)
  {
   c=1;
   pos=i+1;
   break;
  }
 }
 if(c==0)
 {
  printf("Number not found..!!");
 }
 else
 {
  printf("%d found at position %d",num, pos);
 }
 getch();
}&lt;/pre&gt;
&lt;/div&gt;
</description><link>https://tweetprogrammer.blogspot.com/2019/04/program-no-8d-c-program-for-linear.html</link><author>noreply@blogger.com (Mohammad Saquib Khan)</author><thr:total>0</thr:total><georss:featurename>UPSIDC Industrial Area, Naini, Prayagraj, Uttar Pradesh 211009, India</georss:featurename><georss:point>25.3431443 81.910167099999967</georss:point><georss:box>-3.0674802000000021 40.601573099999968 53.7537688 123.21876109999997</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7867323827570382405.post-5255009400526000570</guid><pubDate>Tue, 16 Apr 2019 20:20:00 +0000</pubDate><atom:updated>2019-04-16T13:21:37.763-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Binary</category><category domain="http://www.blogger.com/atom/ns#">conversion</category><category domain="http://www.blogger.com/atom/ns#">Decimal</category><category domain="http://www.blogger.com/atom/ns#">program</category><title>Program no: 8(C) C program to convert Binary to Decimal &amp; Decimal to Binary</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
C program to convert Binary to Decimal &amp;amp; Decimal to Binary.&lt;br /&gt;
&lt;div class="sf-codeh" style="background-color: #fdfdfd; font-family: arial, helvetica, sans-serif; font-size: 21px; font-weight: bold; margin: 40px 0px 20px; text-align: justify;"&gt;
&lt;div style="color: #555555;"&gt;
Program Source Code:&lt;/div&gt;
&lt;div dir="ltr"&gt;
&lt;pre class="lang:c decode:true" style="background-color: #eeeeee; border-color: rgb(153, 153, 153) !important; border-style: solid !important; border-width: 1px !important; box-sizing: border-box; break-inside: avoid; color: purple !important; font-family: Monaco, monacoregular, &amp;quot;courier new&amp;quot;, monospace !important; font-size: 13px !important; font-weight: 300; line-height: 17px !important; max-width: 100%; overflow-wrap: break-word; overflow: auto; padding: 15px 5px; text-shadow: none !important; white-space: pre-wrap;" title="C Program to check whether the Character is Digit or Alphabet"&gt;&lt;/pre&gt;
&lt;pre class="lang:c decode:true" style="background-color: #eeeeee; border-color: rgb(153, 153, 153) !important; border-style: solid !important; border-width: 1px !important; box-sizing: border-box; break-inside: avoid; font-family: Monaco, monacoregular, &amp;quot;courier new&amp;quot;, monospace !important; font-size: 13px !important; font-weight: 300; line-height: 17px !important; max-width: 100%; overflow-wrap: break-word; overflow: auto; padding: 15px 5px; text-shadow: none !important; white-space: pre-wrap;" title="C Program to check whether the Character is Digit or Alphabet"&gt;&lt;div dir="ltr" style="color: purple !important;"&gt;
#include &amp;lt;stdio.h&amp;gt;
int main()
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; int choice;
&amp;nbsp;&amp;nbsp;&amp;nbsp; int&amp;nbsp; num, binary_val, decimal_val = 0, base = 1, rem;
&amp;nbsp;&amp;nbsp; printf("Welcome to Binary &amp;amp; Decimal Converter\n");
&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("Enter 1 for B-D\n");
&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("Enter 2 for D-B\n");
&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("Enter Your Choice:\n");
&amp;nbsp;&amp;nbsp;&amp;nbsp; scanf("%d",&amp;amp;choice);
   switch(choice)
&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp; case 1:
&lt;/div&gt;
&lt;div dir="ltr" style="color: purple !important;"&gt;
&amp;nbsp;   printf("Enter a binary number(1s and 0s) \n");&lt;/div&gt;
&lt;div dir="ltr"&gt;
&lt;span style="color: purple;"&gt;  &amp;nbsp; scanf("%d", &amp;amp;num);
&amp;nbsp;&amp;nbsp;&amp;nbsp; binary_val = num;
&amp;nbsp;&amp;nbsp;&amp;nbsp; while (num &amp;gt; 0)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rem = num % 10;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; decimal_val = decimal_val + rem * base;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; num = num / 10;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; base = base * 2;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("The Binary number is = %d \n", binary_val);
&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("Its decimal equivalent is = %d \n", decimal_val);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;
 &amp;nbsp;&amp;nbsp;&amp;nbsp; case 2: 
&amp;nbsp;&amp;nbsp; long num2, decimal_num, remainder, base2 = 1, binary = 0, no_of_1s = 0;
&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("Enter a decimal integer \n");
&amp;nbsp;&amp;nbsp; scanf("%ld", &amp;amp;num2);
&amp;nbsp;&amp;nbsp;&amp;nbsp; decimal_num = num2;
&amp;nbsp;&amp;nbsp;&amp;nbsp; while (num2 &amp;gt; 0)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; remainder = num2 % 2;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (remainder == 1)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; no_of_1s++;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; binary = binary + remainder * base2;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; num2 = num2 / 2;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; base2 = base2 * 10;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
 &amp;nbsp;&amp;nbsp; printf("Input number is = %ld\n", decimal_num);&lt;/span&gt;&lt;/div&gt;
&lt;div dir="ltr"&gt;
&lt;span style="color: purple;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("Its binary equivalent is = %ld\n", binary);
 &amp;nbsp;&amp;nbsp; printf("No.of 1's in the binary number is = %ld\n", no_of_1s);
 &amp;nbsp;&amp;nbsp; break;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;span style="color: purple;"&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="sf-codeh" style="background-color: #fdfdfd; color: #555555; font-family: Arial, Helvetica, sans-serif; font-size: 21px; font-weight: bold; margin: 40px 0px 20px; text-align: justify;"&gt;
&lt;div class="sf-codeh" style="font-family: Arial, Helvetica, sans-serif; margin: 40px 0px 20px;"&gt;
Program Explanation for decimal to Binary Conversion:&lt;/div&gt;
&lt;div style="font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-weight: 400; line-height: 1.5em; margin-bottom: 10px;"&gt;
In this C program, we are reading the decimal number using ‘num’ variable. A decimal number system is a base 10 number system using digits for 0 to 9 whereas binary number system is base 2 and uses 0 and 1. Check whether the number is less than or equal to zero. Divide the number by 2 and store the remainder in the array. Increase the length of the array by 1. After the execution of while loop, print the binary number and the number of 1’s.&lt;/div&gt;
&lt;/div&gt;
&lt;div class="sf-codeh" style="background-color: #fdfdfd; color: #555555; font-family: Arial, Helvetica, sans-serif; font-size: 21px; font-weight: bold; margin: 40px 0px 20px; text-align: justify;"&gt;
Program Explanation for Binary to Decimal Conversion:&lt;/div&gt;
&lt;div style="background-color: #fdfdfd; color: #555555; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 1.5em; margin-bottom: 10px; text-align: justify;"&gt;
1. Take a binary number and store it in the variable num.&lt;br /&gt;
2. Initialize the variable decimal_val to zero and variable base to 1.&lt;br /&gt;
3. Obtain the remainder and quotient of the binary number. Store the remainder in the variable rem and override the variable num with quotient.&lt;br /&gt;
4. Multiply rem with variable base. Increment the variable decimal_val with this new value.&lt;br /&gt;
5. Increment the variable base by 2.&lt;br /&gt;
6. Repeat the steps 3, 4 and 5 with the quotient obtained until quotient becomes zero.&lt;br /&gt;
7. Print the variable decimal_val as output.&lt;/div&gt;
&lt;/div&gt;
</description><link>https://tweetprogrammer.blogspot.com/2019/04/program-no-8c-c-program-to-convert.html</link><author>noreply@blogger.com (Mohammad Saquib Khan)</author><thr:total>0</thr:total><georss:featurename>UPSIDC Industrial Area, Naini, Prayagraj, Uttar Pradesh 211009, India</georss:featurename><georss:point>25.3431443 81.910167099999967</georss:point><georss:box>-3.0674802000000021 40.601573099999968 53.7537688 123.21876109999997</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7867323827570382405.post-7831392311847798602</guid><pubDate>Tue, 16 Apr 2019 13:56:00 +0000</pubDate><atom:updated>2019-04-16T07:00:31.707-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">array</category><category domain="http://www.blogger.com/atom/ns#">ascending order</category><category domain="http://www.blogger.com/atom/ns#">Pointers</category><category domain="http://www.blogger.com/atom/ns#">program</category><title>Program no: 8(A) C program to insert 10 integer numbers in Array. Print the element of array in ascending order using pointer Method.</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;h4 style="text-align: left;"&gt;
&lt;b&gt;C program to insert 10 integer numbers in&amp;nbsp;&lt;/b&gt;&lt;b&gt;Array. Print the element of array in ascending order using pointer Method.&lt;/b&gt;&lt;/h4&gt;
&lt;div&gt;
&lt;div style="-webkit-font-smoothing: antialiased; background-color: white; box-sizing: border-box; color: #121213; font-family: &amp;quot;Source Sans Pro&amp;quot;, Helvetica, sans-serif; font-size: 16px; overflow-x: hidden; text-align: justify;"&gt;
Write a C program to input elements in an array and sort array using pointers. How to sort an array in ascending or descending order using function pointers in C programming. Logic to sort an array using pointers in program.&lt;/div&gt;
&lt;div class="program-example note" style="-webkit-font-smoothing: antialiased; background-color: white; border-left: 5px solid rgb(167, 167, 167); border-radius: 4px; box-shadow: rgb(245, 243, 243) 1px 3px 10px; box-sizing: border-box; clear: both; color: #121213; font-family: &amp;quot;Source Sans Pro&amp;quot;, Helvetica, sans-serif; font-size: 16px; margin: 30px 0px; padding: 10px 10px 10px 20px; text-align: justify;"&gt;
&lt;div style="-webkit-font-smoothing: antialiased; box-sizing: border-box; overflow-x: hidden;"&gt;
&lt;span style="-webkit-font-smoothing: antialiased; box-sizing: border-box; font-weight: 700;"&gt;Example&lt;/span&gt;&lt;/div&gt;
&lt;div style="-webkit-font-smoothing: antialiased; box-sizing: border-box; overflow-x: hidden;"&gt;
&lt;span style="-webkit-font-smoothing: antialiased; box-sizing: border-box; font-weight: 700;"&gt;Input&lt;/span&gt;&lt;/div&gt;
&lt;pre style="-webkit-font-smoothing: antialiased; background: 0px 0px; box-sizing: border-box; color: black; font-family: Consolas, monospace; font-size: 14px; hyphens: none; overflow-wrap: break-word; overflow: auto; padding: 0px 0px 0px 10px; white-space: pre-wrap;"&gt;Input array elements: 10 -1 0 4 2 100 15 20 24 -5&lt;/pre&gt;
&lt;div style="-webkit-font-smoothing: antialiased; box-sizing: border-box; overflow-x: hidden;"&gt;
&lt;span style="-webkit-font-smoothing: antialiased; box-sizing: border-box; font-weight: 700;"&gt;Output&lt;/span&gt;&lt;/div&gt;
&lt;pre style="-webkit-font-smoothing: antialiased; background: 0px 0px; box-sizing: border-box; color: black; font-family: Consolas, monospace; font-size: 14px; hyphens: none; overflow-wrap: break-word; overflow: auto; padding: 0px 0px 0px 10px; white-space: pre-wrap;"&gt;Array in ascending order: -5, -1, 0, 2, 4, 10, 15, 20, 24, 100,
Array in descending order: 100, 24, 20, 15, 10, 4, 2, 0, -1, -5,&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 id="logic" style="-webkit-font-smoothing: antialiased; background-color: white; box-sizing: border-box; clear: both; color: #121213; font-family: Bitter, Georgia, serif; font-size: 26px; line-height: 1.3; margin: 40px 0px 10px;"&gt;
Source code:&lt;/h2&gt;
&lt;h2 style="-webkit-font-smoothing: antialiased; background-color: white; box-sizing: border-box; clear: both; color: #121213; font-family: Bitter, Georgia, serif; font-size: 26px; line-height: 1.3; margin: 40px 0px 10px;"&gt;
&lt;pre class=" language-c" style="background: rgb(245, 242, 240); border-radius: 0px !important; border: none; box-sizing: border-box; color: black; font-family: Consolas, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, monospace; font-size: 13px; font-weight: 400; hyphens: none; line-height: 1.5; margin-bottom: 0.5em; margin-top: 0.5em; overflow-wrap: normal; overflow: auto; padding: 1em; tab-size: 4; text-shadow: white 0px 1px; word-break: normal;"&gt;&lt;div class="post-text" itemprop="text" style="border: 0px; box-sizing: border-box; font-family: inherit; font-size: 15px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: 1.2; margin: 0px; padding: 15px 10px; vertical-align: baseline; width: 360px; word-break: break-word;"&gt;
&lt;pre class="lang-c prettyprint prettyprinted" style="background-color: #f0f0f0; border: 0px; box-sizing: inherit; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 0.8em; max-height: 300px; overflow-wrap: normal; overflow: auto; padding: 10px; vertical-align: baseline;"&gt;&lt;code style="border: 0px; box-sizing: inherit; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; max-height: 300px; overflow: auto; padding: 0px; vertical-align: baseline;"&gt;&lt;span class="com" style="border: 0px; box-sizing: inherit; color: #858c93; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;#include&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt; &lt;/span&gt;&lt;span class="str" style="border: 0px; box-sizing: inherit; color: #7d2727; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;
&lt;/span&gt;&lt;span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;void&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt; main&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;()&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;
&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;{&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;
    &lt;/span&gt;&lt;span class="typ" style="border: 0px; box-sizing: inherit; color: #2b91af; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;int&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt; a&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;[&lt;/span&gt;&lt;span class="lit" style="border: 0px; box-sizing: inherit; color: #7d2727; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;100&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;],&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;i&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;,&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;n&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;,&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;j&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;,&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;t&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;
    printf&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;(&lt;/span&gt;&lt;span class="str" style="border: 0px; box-sizing: inherit; color: #7d2727; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;"Enter number of elements:\n"&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;);&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;
    scanf&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;(&lt;/span&gt;&lt;span class="str" style="border: 0px; box-sizing: inherit; color: #7d2727; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;"%d"&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;,&amp;amp;&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;n&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;);&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;
    printf&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;(&lt;/span&gt;&lt;span class="str" style="border: 0px; box-sizing: inherit; color: #7d2727; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;"Enter array:\n"&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;);&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;
    &lt;/span&gt;&lt;span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;for&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt; &lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;(&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;i&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;=&lt;/span&gt;&lt;span class="lit" style="border: 0px; box-sizing: inherit; color: #7d2727; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;0&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt; i&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;&amp;lt;&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;n&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt; i&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;++)&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;
    &lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;{&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;
        scanf&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;(&lt;/span&gt;&lt;span class="str" style="border: 0px; box-sizing: inherit; color: #7d2727; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;"%d"&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;,&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;a&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;+&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;i&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;);&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;
    &lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;}&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;
    &lt;/span&gt;&lt;span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;for&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt; &lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;(&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;i&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;=&lt;/span&gt;&lt;span class="lit" style="border: 0px; box-sizing: inherit; color: #7d2727; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;0&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt; i&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;&amp;lt;(&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;n&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;-&lt;/span&gt;&lt;span class="lit" style="border: 0px; box-sizing: inherit; color: #7d2727; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;1&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;);&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt; i&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;++)&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;
    &lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;{&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;
        &lt;/span&gt;&lt;span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;for&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt; &lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;(&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;j&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;=&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;i&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;+&lt;/span&gt;&lt;span class="lit" style="border: 0px; box-sizing: inherit; color: #7d2727; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;1&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt; i&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;&amp;lt;&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;n&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt; i&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;++)&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;
        &lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;{&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;
            &lt;/span&gt;&lt;span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;if&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt; &lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;(*(&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;a&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;+&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;i&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;)&amp;gt;*(&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;a&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;+&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;j&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;))&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;
            &lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;{&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;
                t&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;=*(&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;a&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;+&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;i&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;);&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;
                &lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;*(&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;a&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;+&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;i&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;)=*(&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;a&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;+&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;j&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;);&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;
                &lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;*(&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;a&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;+&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;j&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;)=&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;t&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;
            &lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;}&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;
        &lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;}&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;
    &lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;}&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;
    printf&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;(&lt;/span&gt;&lt;span class="str" style="border: 0px; box-sizing: inherit; color: #7d2727; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;"Sorted array (ascending) is:\n"&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;);&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;
    &lt;/span&gt;&lt;span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;for&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt; &lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;(&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;i&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;=&lt;/span&gt;&lt;span class="lit" style="border: 0px; box-sizing: inherit; color: #7d2727; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;0&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt; i&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;&amp;lt;&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;n&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt; i&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;++)&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;
    &lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;{&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;
        printf&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;(&lt;/span&gt;&lt;span class="str" style="border: 0px; box-sizing: inherit; color: #7d2727; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;"%d "&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;,*(&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;a&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;+&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;i&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;));&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;
    &lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;}&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;
    printf&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;(&lt;/span&gt;&lt;span class="str" style="border: 0px; box-sizing: inherit; color: #7d2727; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;"\n"&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;);&lt;/span&gt;&lt;span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;
&lt;/span&gt;&lt;span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;logic behind the C program&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style="background-color: white; color: #121213; font-family: &amp;quot;source sans pro&amp;quot;, helvetica, sans-serif; font-size: 16px; text-align: justify;"&gt;Below is the step by step descriptive logic to sort an array using pointer.&lt;/span&gt;&lt;br /&gt;
&lt;div style="-webkit-font-smoothing: antialiased; background-color: white; box-sizing: border-box; color: #121213; font-family: &amp;quot;Source Sans Pro&amp;quot;, Helvetica, sans-serif; font-size: 16px; overflow-x: hidden; text-align: justify;"&gt;
&lt;/div&gt;
&lt;ol style="-webkit-font-smoothing: antialiased; background-color: white; box-sizing: border-box; color: #121213; font-family: &amp;quot;Source Sans Pro&amp;quot;, Helvetica, sans-serif; font-size: 16px; margin: 16px 0px; padding: 0px 0px 0px 40px; text-align: justify;"&gt;
&lt;li style="-webkit-font-smoothing: antialiased; box-sizing: border-box; margin: 5px 0px;"&gt;Input size and elements in array. Store them in some variable say&amp;nbsp;&lt;code style="-webkit-font-smoothing: antialiased; background-color: #eaeaea; border-radius: 1px; box-sizing: border-box; display: inline-block; font-family: Consolas, monospace; font-size: 14.4px; hyphens: none; margin: 3px; padding: 0px 4px;"&gt;size&lt;/code&gt;&amp;nbsp;and&amp;nbsp;&lt;code style="-webkit-font-smoothing: antialiased; background-color: #eaeaea; border-radius: 1px; box-sizing: border-box; display: inline-block; font-family: Consolas, monospace; font-size: 14.4px; hyphens: none; margin: 3px; padding: 0px 4px;"&gt;arr&lt;/code&gt;.&lt;/li&gt;
&lt;li style="-webkit-font-smoothing: antialiased; box-sizing: border-box; margin: 5px 0px;"&gt;Declare two function with prototype&amp;nbsp;&lt;code style="-webkit-font-smoothing: antialiased; background-color: #eaeaea; border-radius: 1px; box-sizing: border-box; display: inline-block; font-family: Consolas, monospace; font-size: 14.4px; hyphens: none; margin: 3px; padding: 0px 4px;"&gt;int sortAscending(int * num1, int * num2)&lt;/code&gt;&amp;nbsp;and&amp;nbsp;&lt;code style="-webkit-font-smoothing: antialiased; background-color: #eaeaea; border-radius: 1px; box-sizing: border-box; display: inline-block; font-family: Consolas, monospace; font-size: 14.4px; hyphens: none; margin: 3px; padding: 0px 4px;"&gt;int sortDescending(int * num1, int * num2)&lt;/code&gt;.&lt;div style="-webkit-font-smoothing: antialiased; box-sizing: border-box; overflow-x: hidden;"&gt;
Both the functions are used to compare two elements and arrange it in either ascending or descending order.&amp;nbsp;&lt;code style="-webkit-font-smoothing: antialiased; background-color: #eaeaea; border-radius: 1px; box-sizing: border-box; display: inline-block; font-family: Consolas, monospace; font-size: 14.4px; hyphens: none; margin: 3px; padding: 0px 4px;"&gt;sortAscending()&lt;/code&gt;&amp;nbsp;returns negative value if&amp;nbsp;&lt;code style="-webkit-font-smoothing: antialiased; background-color: #eaeaea; border-radius: 1px; box-sizing: border-box; display: inline-block; font-family: Consolas, monospace; font-size: 14.4px; hyphens: none; margin: 3px; padding: 0px 4px;"&gt;num1&lt;/code&gt;&amp;nbsp;is less than&amp;nbsp;&lt;code style="-webkit-font-smoothing: antialiased; background-color: #eaeaea; border-radius: 1px; box-sizing: border-box; display: inline-block; font-family: Consolas, monospace; font-size: 14.4px; hyphens: none; margin: 3px; padding: 0px 4px;"&gt;num2&lt;/code&gt;, positive value if&amp;nbsp;&lt;code style="-webkit-font-smoothing: antialiased; background-color: #eaeaea; border-radius: 1px; box-sizing: border-box; display: inline-block; font-family: Consolas, monospace; font-size: 14.4px; hyphens: none; margin: 3px; padding: 0px 4px;"&gt;num1&lt;/code&gt;&amp;nbsp;is greater than&amp;nbsp;&lt;code style="-webkit-font-smoothing: antialiased; background-color: #eaeaea; border-radius: 1px; box-sizing: border-box; display: inline-block; font-family: Consolas, monospace; font-size: 14.4px; hyphens: none; margin: 3px; padding: 0px 4px;"&gt;num2&lt;/code&gt;and zero if both are equal.&lt;/div&gt;
&lt;div style="-webkit-font-smoothing: antialiased; box-sizing: border-box; overflow-x: hidden;"&gt;
Similarly,&amp;nbsp;&lt;code style="-webkit-font-smoothing: antialiased; background-color: #eaeaea; border-radius: 1px; box-sizing: border-box; display: inline-block; font-family: Consolas, monospace; font-size: 14.4px; hyphens: none; margin: 3px; padding: 0px 4px;"&gt;sortDescending()&lt;/code&gt;&amp;nbsp;returns negative value if&amp;nbsp;&lt;code style="-webkit-font-smoothing: antialiased; background-color: #eaeaea; border-radius: 1px; box-sizing: border-box; display: inline-block; font-family: Consolas, monospace; font-size: 14.4px; hyphens: none; margin: 3px; padding: 0px 4px;"&gt;num1&lt;/code&gt;&amp;nbsp;is greater than&amp;nbsp;&lt;code style="-webkit-font-smoothing: antialiased; background-color: #eaeaea; border-radius: 1px; box-sizing: border-box; display: inline-block; font-family: Consolas, monospace; font-size: 14.4px; hyphens: none; margin: 3px; padding: 0px 4px;"&gt;num2&lt;/code&gt;, positive value if&amp;nbsp;&lt;code style="-webkit-font-smoothing: antialiased; background-color: #eaeaea; border-radius: 1px; box-sizing: border-box; display: inline-block; font-family: Consolas, monospace; font-size: 14.4px; hyphens: none; margin: 3px; padding: 0px 4px;"&gt;num2&lt;/code&gt;&amp;nbsp;is greater than&amp;nbsp;&lt;code style="-webkit-font-smoothing: antialiased; background-color: #eaeaea; border-radius: 1px; box-sizing: border-box; display: inline-block; font-family: Consolas, monospace; font-size: 14.4px; hyphens: none; margin: 3px; padding: 0px 4px;"&gt;num1&lt;/code&gt;&amp;nbsp;and zero if both are equal.&lt;/div&gt;
&lt;/li&gt;
&lt;li style="-webkit-font-smoothing: antialiased; box-sizing: border-box; margin: 5px 0px;"&gt;Declare another function to sort array with prototype&amp;nbsp;&lt;code style="-webkit-font-smoothing: antialiased; background-color: #eaeaea; border-radius: 1px; box-sizing: border-box; display: inline-block; font-family: Consolas, monospace; font-size: 14.4px; hyphens: none; margin: 3px; padding: 0px 4px;"&gt;void sort(int * arr, int size, int (* compare)(int *, int *))&lt;/code&gt;.&lt;div style="-webkit-font-smoothing: antialiased; box-sizing: border-box; overflow-x: hidden;"&gt;
It takes three parameter, where first parameter is the array to sort, second is size of array and third is a function pointer.&lt;/div&gt;
&lt;div style="-webkit-font-smoothing: antialiased; box-sizing: border-box; overflow-x: hidden;"&gt;
&lt;span style="-webkit-font-smoothing: antialiased; box-sizing: border-box; font-weight: 700;"&gt;Note:&lt;/span&gt;&amp;nbsp;The function pointer passed here will decide relationship between two elements to be sorted. If you want to sort elements in ascending order then pass reference of&amp;nbsp;&lt;code style="-webkit-font-smoothing: antialiased; background-color: #eaeaea; border-radius: 1px; box-sizing: border-box; display: inline-block; font-family: Consolas, monospace; font-size: 14.4px; hyphens: none; margin: 3px; padding: 0px 4px;"&gt;sortAscending()&lt;/code&gt;&amp;nbsp;function, otherwise&amp;nbsp;&lt;code style="-webkit-font-smoothing: antialiased; background-color: #eaeaea; border-radius: 1px; box-sizing: border-box; display: inline-block; font-family: Consolas, monospace; font-size: 14.4px; hyphens: none; margin: 3px; padding: 0px 4px;"&gt;sortDescending()&lt;/code&gt;&amp;nbsp;function.&lt;/div&gt;
&lt;div style="-webkit-font-smoothing: antialiased; box-sizing: border-box; overflow-x: hidden;"&gt;
To sort an array I have used&amp;nbsp;&lt;a href="https://codeforwin.org/2015/07/c-program-to-sort-array-in-ascending-order.html" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; color: #0054d4; text-decoration-line: none;"&gt;basic sorting algorithm&lt;/a&gt;. The algorithm is not efficient when compared to other modern sorting algorithms but its easy to understand and use.&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
</description><link>https://tweetprogrammer.blogspot.com/2019/04/program-no-8a.html</link><author>noreply@blogger.com (Mohammad Saquib Khan)</author><thr:total>0</thr:total><georss:featurename>A-31, UPSIDC Industrial Area, Naini, Prayagraj, Uttar Pradesh 211009, India</georss:featurename><georss:point>25.4331064 81.841561599999977</georss:point><georss:box>-2.9775400999999988 40.532967599999978 53.8437529 123.15015559999998</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7867323827570382405.post-499296959401602352</guid><pubDate>Tue, 26 Feb 2019 13:34:00 +0000</pubDate><atom:updated>2019-02-26T05:34:38.581-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">call by reference</category><category domain="http://www.blogger.com/atom/ns#">Swapping</category><title>C Program To Swap Two Numbers without using pointer</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;h1 class="entry-title" itemprop="headline" style="box-sizing: border-box; color: #333333; font-size: 30px; line-height: 1; margin: 0px 0px 16px;"&gt;
&lt;span style="background-color: white; font-family: &amp;quot;eb garamond&amp;quot;, serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style="background-color: #eeeeee;"&gt;&lt;u&gt;&lt;span style="font-family: Georgia, Times New Roman, serif;"&gt;Swapping&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="background-color: white; font-family: &amp;quot;eb garamond&amp;quot;, serif;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/h1&gt;
&lt;h1 class="entry-title" itemprop="headline" style="background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;eb garamond&amp;quot;, serif; line-height: 1; margin: 0px 0px 16px;"&gt;
&lt;span style="font-size: large;"&gt;
C Program to Swap Two Numbers&lt;/span&gt;&lt;/h1&gt;
&lt;div&gt;
&lt;div style="background-color: white; box-sizing: border-box; color: #333333; font-family: questrial, sans-serif; font-size: 18px; margin-bottom: 26px; padding: 0px; text-align: justify;"&gt;
In this article, we will discuss how to write a&amp;nbsp;&lt;a href="https://www.tutorialgateway.org/c-programming/" style="box-sizing: border-box; color: #de3233; text-decoration-line: none; transition: all 0.1s ease-in-out 0s;"&gt;C&lt;/a&gt;&amp;nbsp;program to swap two number using a temporary variable and also without using a temporary or third variable.&lt;/div&gt;
&lt;span id="ezoic-pub-ad-placeholder-104" style="background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;questrial&amp;quot; , sans-serif; font-size: 18px; text-align: justify;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style="background-color: white; box-sizing: border-box; color: #333333; font-family: questrial, sans-serif; font-size: 18px; margin-bottom: 26px; padding: 0px; text-align: justify;"&gt;
For this C Program to Swap Two Numbers purpose, we are going to use Pointers, Functions, Arithmetic Operators, Bitwise Operators,&amp;nbsp;&lt;a href="https://www.tutorialgateway.org/call-by-value-and-call-by-reference-in-c/" style="box-sizing: border-box; color: #de3233; text-decoration-line: none; transition: all 0.1s ease-in-out 0s;" title="Passing Parameters to the Function"&gt;Call By Reference in C&lt;/a&gt;&amp;nbsp;concepts.&lt;/div&gt;
&lt;div style="background-color: white; box-sizing: border-box; color: #333333; font-family: questrial, sans-serif; font-size: 18px; margin-bottom: 26px; padding: 0px; text-align: justify;"&gt;
This&amp;nbsp;&lt;a href="https://www.tutorialgateway.org/c-programming-examples/" style="box-sizing: border-box; color: #de3233; text-decoration-line: none; transition: all 0.1s ease-in-out 0s;"&gt;C program&lt;/a&gt;&amp;nbsp;allows the user to enter two integer values. Using the third variable, this C program Swap two numbers.&lt;br /&gt;
&lt;u style="background-color: transparent;"&gt;&lt;b style="background-color: #eeeeee;"&gt;&lt;br /&gt;&lt;/b&gt;&lt;/u&gt;
&lt;u style="background-color: transparent;"&gt;&lt;b style="background-color: #eeeeee;"&gt;Source Code:&lt;/b&gt;&lt;/u&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: #eeeeee;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre class="lang:c decode:true" style="background-color: #eeeeee; border-color: rgb(153, 153, 153) !important; border-style: solid !important; border-width: 1px !important; box-sizing: border-box; break-inside: avoid; color: purple !important; font-family: Monaco, monacoregular, &amp;quot;courier new&amp;quot;, monospace !important; font-size: 12px !important; line-height: 15px !important; max-width: 100%; overflow-wrap: break-word; overflow: auto; padding: 0px 5px; text-align: justify; text-shadow: none !important; white-space: pre-wrap;" title="C Program to Swap Two Numbers"&gt;/* C Program to Swap Two Numbers */

#include 

int main()
{
  int a, b, Temp;
 
  printf("\nPlease Enter the value of a and b\n");
  scanf("%d %d", &amp;amp;a, &amp;amp;b);
 
  printf("\nBefore Swap: a = %d and b = %d\n", a, b);
 
  Temp = a;
  a    = b;
  b    = Temp;
 
  printf("\nAfter Swapping: a = %d and b = %d\n", a, b);
 
  return 0;
}&lt;/pre&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: #eeeeee;"&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style="background-color: #eeeeee;"&gt;&lt;b&gt;&lt;u&gt;Output Console:&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiND9B3bDMWKEnya3nyiKETuPeumt55tP4srL9ibB3sMZdHfnJ71xzXVC14NK1stf1-KiCUdHyF7bAObcfM1UgACvVY3T45BFjVR54XpfEhglr0CD_dRWEw8G487HXH8G9V9U0R8gAyHTWA/s1600/Screenshot_20190226_185425.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" data-original-height="586" data-original-width="532" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiND9B3bDMWKEnya3nyiKETuPeumt55tP4srL9ibB3sMZdHfnJ71xzXVC14NK1stf1-KiCUdHyF7bAObcfM1UgACvVY3T45BFjVR54XpfEhglr0CD_dRWEw8G487HXH8G9V9U0R8gAyHTWA/s200/Screenshot_20190226_185425.png" width="181" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi87oikzqP2M0brkUEl_ndH0BNSOW29W8YhvZTk2tnNlBqvVCtLbB4EOeDEkXRJXwtWp0Kn73L7j5jukxa8AK7AcetjYsOoqMbiJIgSNYl1lUTze3Z5Tob5csQ9XoKlWtpnR4Q6LU6wjND3/s1600/Screenshot_20190226_185444.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" data-original-height="203" data-original-width="484" height="83" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi87oikzqP2M0brkUEl_ndH0BNSOW29W8YhvZTk2tnNlBqvVCtLbB4EOeDEkXRJXwtWp0Kn73L7j5jukxa8AK7AcetjYsOoqMbiJIgSNYl1lUTze3Z5Tob5csQ9XoKlWtpnR4Q6LU6wjND3/s200/Screenshot_20190226_185444.png" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style="background-color: #eeeeee;"&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style="background-color: #eeeeee;"&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style="background-color: #eeeeee;"&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;
&lt;div style="box-sizing: border-box; color: #333333; font-family: questrial, sans-serif; font-size: 18px; margin-bottom: 26px; padding: 0px; text-align: justify;"&gt;
&lt;/div&gt;
&lt;h3&gt;
&lt;b style="background-color: #cccccc;"&gt;&lt;u&gt;Analysis:&lt;/u&gt;&lt;/b&gt;&lt;/h3&gt;
&lt;span style="background-color: white;"&gt;Within this C Program to Swap Two Numbers, we assigned a = 6 and b = 13&lt;/span&gt;&lt;br /&gt;
&lt;div style="background-color: white; box-sizing: border-box; color: #333333; font-family: questrial, sans-serif; font-size: 18px; margin-bottom: 26px; padding: 0px; text-align: justify;"&gt;
Temp = a – it means assigning the a value to the Temp variable&lt;br style="box-sizing: border-box;" /&gt;Temp = 6&lt;span class="ezoic-adpicker-ad" id="ezoic-pub-ad-placeholder-125" style="box-sizing: border-box;"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; box-sizing: border-box; color: #333333; font-family: questrial, sans-serif; font-size: 18px; margin-bottom: 26px; padding: 0px; text-align: justify;"&gt;
a = b – it means assigning the b value to the variable a&lt;br style="box-sizing: border-box;" /&gt;a = 13&lt;/div&gt;
&lt;span style="background-color: #eeeeee;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style="background-color: white; box-sizing: border-box; color: #333333; font-family: questrial, sans-serif; font-size: 18px; margin-bottom: 26px; padding: 0px; text-align: justify;"&gt;
b = Temp – it means assigning the Temp value to the variable b&lt;br style="box-sizing: border-box;" /&gt;b = 6&lt;br style="box-sizing: border-box;" /&gt;Last Printf statement will print the a, b values as output.&lt;/div&gt;
&lt;span style="background-color: #eeeeee;"&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style="background-color: #eeeeee;"&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</description><link>https://tweetprogrammer.blogspot.com/2019/02/c-program-to-swap-two-numbers-without.html</link><author>noreply@blogger.com (Mohammad Saquib Khan)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiND9B3bDMWKEnya3nyiKETuPeumt55tP4srL9ibB3sMZdHfnJ71xzXVC14NK1stf1-KiCUdHyF7bAObcfM1UgACvVY3T45BFjVR54XpfEhglr0CD_dRWEw8G487HXH8G9V9U0R8gAyHTWA/s72-c/Screenshot_20190226_185425.png" width="72"/><thr:total>0</thr:total><georss:featurename>Prayagraj, Uttar Pradesh, India</georss:featurename><georss:point>25.4358011 81.846311000000014</georss:point><georss:box>25.2063056 81.523587500000019 25.665296599999998 82.169034500000009</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7867323827570382405.post-5162804961499765579</guid><pubDate>Tue, 19 Feb 2019 15:41:00 +0000</pubDate><atom:updated>2019-02-19T07:45:22.184-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Area</category><category domain="http://www.blogger.com/atom/ns#">Beginner</category><category domain="http://www.blogger.com/atom/ns#">Circle</category><category domain="http://www.blogger.com/atom/ns#">Circumference</category><category domain="http://www.blogger.com/atom/ns#">Diameter</category><title>#6: C Program to find Diameter,Area,Circumference of Circle</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;h2 style="text-align: left;"&gt;
&lt;b&gt;&lt;u style="background-color: #f3f3f3;"&gt;Diameter, Area &amp;amp; Circumference of Circle&lt;/u&gt;&lt;/b&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;h1 class="entry-title" itemprop="headline" style="background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;eb garamond&amp;quot;, serif; font-size: 30px; line-height: 1; margin: 0px 0px 16px;"&gt;
C Program to find Diameter, Circumference, and Area Of a Circle&lt;/h1&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: white; color: #333333; font-family: &amp;quot;questrial&amp;quot; , sans-serif; font-size: 18px; text-align: justify;"&gt;In this article, we will show you, How to write a&amp;nbsp;&lt;/span&gt;&lt;a href="https://www.tutorialgateway.org/c-programming/" style="background-color: white; box-sizing: border-box; color: #de3233; font-family: questrial, sans-serif; font-size: 18px; text-align: justify; text-decoration-line: none; transition: all 0.1s ease-in-out 0s;"&gt;C&lt;/a&gt;&lt;span style="background-color: white; color: #333333; font-family: &amp;quot;questrial&amp;quot; , sans-serif; font-size: 18px; text-align: justify;"&gt;&amp;nbsp;Program to find Diameter, Circumference, and Area Of a Circle using Functions with example.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #333333; font-family: &amp;quot;eb garamond&amp;quot; , serif; font-size: 30px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;h3&gt;
&lt;span style="color: #333333; font-family: &amp;quot;eb garamond&amp;quot; , serif; font-size: 30px;"&gt;The mathematical formulas behind these calculations are:&lt;/span&gt;&lt;/h3&gt;
&lt;div&gt;
&lt;ol style="background-color: white; box-sizing: border-box; color: #333333; font-family: questrial, sans-serif; font-size: 18px; margin: 0px 0px 26px 40px; padding: 0px; text-align: justify;"&gt;
&lt;li style="box-sizing: border-box; list-style-type: decimal;"&gt;Diameter of a Circle = 2r = 2 * radius&lt;/li&gt;
&lt;li style="box-sizing: border-box; list-style-type: decimal;"&gt;Circumference of a Circle = 2&lt;span class="Apple-style-span" style="box-sizing: border-box;"&gt;π&lt;/span&gt;r = 2 *&amp;nbsp;&lt;span class="Apple-style-span" style="box-sizing: border-box;"&gt;π *&amp;nbsp;&lt;/span&gt;radius&lt;/li&gt;
&lt;li style="box-sizing: border-box; list-style-type: decimal;"&gt;Area of a circle is:&amp;nbsp;&lt;span class="Apple-style-span" style="box-sizing: border-box;"&gt;A = πr² =&amp;nbsp;&lt;/span&gt;&amp;nbsp;&lt;span class="Apple-style-span" style="box-sizing: border-box;"&gt;π * radius * radius&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="tip" style="background-color: whitesmoke; border-bottom-color: rgb(32, 178, 170); border-left: 0.475rem solid rgb(32, 178, 170); border-right-color: rgb(32, 178, 170); border-top-color: rgb(32, 178, 170); box-sizing: border-box; color: #333333; font-family: questrial, sans-serif; font-size: 18px; margin-bottom: 26px; margin-top: 1.25rem; padding: 1.25rem; text-align: justify;"&gt;
&lt;span style="box-sizing: border-box; font-weight: 700;"&gt;TIP:&lt;/span&gt;&amp;nbsp;Please refer&amp;nbsp;&lt;a href="https://www.tutorialgateway.org/c-program-to-calculate-area-of-a-circle/" style="box-sizing: border-box; color: #de3233; text-decoration-line: none; transition: all 0.1s ease-in-out 0s;"&gt;C Program to Calculate Area Of a Circle&lt;/a&gt;&amp;nbsp;article to understand the various ways to calculate Area of a Circle.&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3 style="text-align: left;"&gt;
&lt;u&gt;
Source code:&lt;/u&gt;&lt;/h3&gt;
&lt;div&gt;
&lt;pre class="lang:c decode:true" style="background-color: #eeeeee; border-color: rgb(153, 153, 153) !important; border-style: solid !important; border-width: 1px !important; box-sizing: border-box; break-inside: avoid; color: purple !important; font-family: Monaco, monacoregular, &amp;quot;courier new&amp;quot;, monospace !important; font-size: 12px !important; line-height: 15px !important; max-width: 100%; overflow-wrap: break-word; overflow: auto; padding: 0px 5px; text-align: justify; text-shadow: none !important; white-space: pre-wrap;" title="C Program to find Diameter, Circumference, and Area Of a Circle"&gt;/* C Program to find Diameter, Circumference, and Area Of a Circle */
 
#include&amp;lt;stdio.h&amp;gt;
 
#define PI 3.14
 
int main()
{
  float radius, area, circumference, diameter;
 
  printf("\n Please Enter the radius of a circle : ");
  scanf("%f",&amp;amp;radius);
 
  diameter = 2 * radius;
  circumference = 2 * PI * radius;
  area = PI * radius * radius; 
 
  printf("\n Diameter Of a Circle = %.2f\n", diameter);
  printf("\n Circumference Of a Circle = %.2f\n", circumference);
  printf("\n Area Of a Circle = %.2f\n", area);
 
  return 0;
}&lt;/pre&gt;
&lt;div style="background-color: white; box-sizing: border-box; color: #333333; font-family: questrial, sans-serif; font-size: 18px; margin-bottom: 26px; padding: 0px; text-align: justify;"&gt;
&lt;span style="background-color: transparent; text-align: left;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h3 style="background-color: white; box-sizing: border-box; color: #333333; font-family: questrial, sans-serif; font-size: 18px; margin-bottom: 26px; padding: 0px; text-align: justify;"&gt;
&lt;span style="background-color: transparent; text-align: left;"&gt;&lt;b&gt;&lt;u&gt;Output Console:&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;div class="separator" style="clear: both; display: inline !important; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVc-dmro9Sv2bW2Val_T5LqGul8S3s_qKwtyXfq96hVvHK2yKZKLGkNM2gr0FCLGo-9xXQz11TOHhWdjV5AyhqxFHll7zvOscVlHInHfUc1OfdwKYIgm5nUnKXheVtevO0YHavpY9BaxD_/s1600/Screenshot_20190219_170656.png" imageanchor="1" style="clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" data-original-height="611" data-original-width="539" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVc-dmro9Sv2bW2Val_T5LqGul8S3s_qKwtyXfq96hVvHK2yKZKLGkNM2gr0FCLGo-9xXQz11TOHhWdjV5AyhqxFHll7zvOscVlHInHfUc1OfdwKYIgm5nUnKXheVtevO0YHavpY9BaxD_/s200/Screenshot_20190219_170656.png" width="176" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9gO2F003Xo-wIbqDWtHFVUgEUV5Lq0szUrgIpLK4TgWeGkx-r-5LbqeL41hi32qVfm8uc1sqnemr6JmkbXPoPSljVgIMOm3z1bSUtwjfLy_hq43461EbJluUNZ_Y7qJeqQyG6SybZKNkJ/s1600/Screenshot_20190219_170614.png" imageanchor="1" style="background-color: transparent; margin-left: 1em; margin-right: 1em; text-align: center;"&gt;&lt;img border="0" data-original-height="327" data-original-width="533" height="122" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9gO2F003Xo-wIbqDWtHFVUgEUV5Lq0szUrgIpLK4TgWeGkx-r-5LbqeL41hi32qVfm8uc1sqnemr6JmkbXPoPSljVgIMOm3z1bSUtwjfLy_hq43461EbJluUNZ_Y7qJeqQyG6SybZKNkJ/s200/Screenshot_20190219_170614.png" width="200" /&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: transparent; text-align: left;"&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</description><link>https://tweetprogrammer.blogspot.com/2019/02/diameter-area-circumference-of-circle-c.html</link><author>noreply@blogger.com (Mohammad Saquib Khan)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVc-dmro9Sv2bW2Val_T5LqGul8S3s_qKwtyXfq96hVvHK2yKZKLGkNM2gr0FCLGo-9xXQz11TOHhWdjV5AyhqxFHll7zvOscVlHInHfUc1OfdwKYIgm5nUnKXheVtevO0YHavpY9BaxD_/s72-c/Screenshot_20190219_170656.png" width="72"/><thr:total>0</thr:total><georss:featurename>Prayagraj, Uttar Pradesh, India</georss:featurename><georss:point>25.4358011 81.846311000000014</georss:point><georss:box>25.2063056 81.523587500000019 25.665296599999998 82.169034500000009</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7867323827570382405.post-5663311291626430914</guid><pubDate>Tue, 19 Feb 2019 10:36:00 +0000</pubDate><atom:updated>2019-02-19T02:36:43.435-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Even</category><category domain="http://www.blogger.com/atom/ns#">odd</category><title>#5: C Program to Find the Integer For Even Or Odd</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;h2 style="text-align: left;"&gt;
&amp;nbsp;&lt;b&gt;&lt;u&gt; To Check the integer is Even or Odd&lt;/u&gt;&lt;/b&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;h2 style="background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;eb garamond&amp;quot;, serif; font-size: 30px; line-height: 1.2; margin: 0px 0px 16px; text-align: justify;"&gt;
&lt;span lang="EN-GB" style="box-sizing: border-box;"&gt;C Program to Check Odd or Even using IF Condition&lt;/span&gt;&lt;/h2&gt;
&lt;div style="background-color: white; box-sizing: border-box; color: #333333; font-family: questrial, sans-serif; font-size: 18px; margin-bottom: 26px; padding: 0px; text-align: justify;"&gt;
This&amp;nbsp;&lt;a href="https://www.tutorialgateway.org/c-programming-examples/" style="box-sizing: border-box; color: #de3233; text-decoration-line: none; transition: all 0.1s ease-in-out 0s;"&gt;C program&lt;/a&gt;&amp;nbsp;allows the user to enter integer and checks whether that number is even or odd using&amp;nbsp;&lt;a href="https://www.tutorialgateway.org/if-statement-in-c/" style="box-sizing: border-box; color: #de3233; text-decoration-line: none; transition: all 0.1s ease-in-out 0s;" title="If Statement in C"&gt;If statement&lt;/a&gt;.&lt;/div&gt;
&lt;div style="background-color: white; box-sizing: border-box; color: #333333; font-family: questrial, sans-serif; font-size: 18px; margin-bottom: 26px; padding: 0px; text-align: justify;"&gt;
&lt;b&gt;&lt;u&gt;Source Code:&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;pre class="lang:c decode:true" style="background-color: #eeeeee; border-color: rgb(153, 153, 153) !important; border-style: solid !important; border-width: 1px !important; box-sizing: border-box; break-inside: avoid; color: purple !important; font-size: 12px !important; line-height: 15px !important; max-width: 100%; overflow-wrap: break-word; overflow: auto; padding: 0px 5px; text-align: justify; text-shadow: none !important; white-space: pre-wrap;" title="C Program for Even or odd using IF Condition"&gt;&lt;span style="font-family: Times, Times New Roman, serif;"&gt;&lt;b&gt;/* C Program to Check Odd or Even using IF Condition */

#include&amp;lt;stdio.h&amp;gt;

int main()
{
  int number;

  printf(" Enter an int value to check Even or Odd \n");
  scanf("%d", &amp;amp;number);
  
  if ( number%2 == 0 ) //Check whether remainder is 0 or not
     printf("Given number %d is EVEN NUMBER \n", number);

  else
    printf("Given number %d is ODD NUMBER \n", number);

  return 0;
}&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;div style="background-color: white; box-sizing: border-box; color: #333333; font-family: questrial, sans-serif; font-size: 18px; margin-bottom: 26px; padding: 0px; text-align: justify;"&gt;
&lt;b&gt;&lt;u&gt;Output Console:&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style="background-color: white; box-sizing: border-box; color: #333333; font-family: questrial, sans-serif; font-size: 18px; margin-bottom: 26px; padding: 0px; text-align: justify;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj42Q9Thtejm25Zupi7WJ0czGH-OSQtOzMDst5Ta2O0WpasOudjwiJev7Tzq8nhkpeeZ1IGRzQM4Xn94ObiO3ZTPSHxO1gtToRczdXdF-aFTtTbZRd79OAMf8o1yHqaIEgutUG0w2LtupCI/s1600/Screenshot_20190219_155640.png" imageanchor="1" style="background-color: transparent; margin-left: 1em; margin-right: 1em; text-align: center;"&gt;&lt;img border="0" data-original-height="567" data-original-width="529" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj42Q9Thtejm25Zupi7WJ0czGH-OSQtOzMDst5Ta2O0WpasOudjwiJev7Tzq8nhkpeeZ1IGRzQM4Xn94ObiO3ZTPSHxO1gtToRczdXdF-aFTtTbZRd79OAMf8o1yHqaIEgutUG0w2LtupCI/s200/Screenshot_20190219_155640.png" width="186" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_SSkeNtapg3twKuiQY29vBTKaq7e9PNU8RcIpUbXoFPlzvx9E58bGF-3R2eqcQXVx5rHxD8GhtnJTnD_42rCSKEelA3xZCvGbhzxviNnzQDPyGme6Ja2nG4L-eF5NyZPgU7REHyNeknWJ/s1600/Screenshot_20190219_155610.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" data-original-height="210" data-original-width="531" height="78" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_SSkeNtapg3twKuiQY29vBTKaq7e9PNU8RcIpUbXoFPlzvx9E58bGF-3R2eqcQXVx5rHxD8GhtnJTnD_42rCSKEelA3xZCvGbhzxviNnzQDPyGme6Ja2nG4L-eF5NyZPgU7REHyNeknWJ/s200/Screenshot_20190219_155610.png" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="background-color: white; box-sizing: border-box; color: #333333; font-family: questrial, sans-serif; font-size: 18px; margin-bottom: 26px; padding: 0px; text-align: justify;"&gt;
&lt;span style="box-sizing: border-box; font-weight: 700;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; box-sizing: border-box; color: #333333; font-family: questrial, sans-serif; font-size: 18px; margin-bottom: 26px; padding: 0px; text-align: justify;"&gt;
&lt;span style="box-sizing: border-box; font-weight: 700;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h2 style="background-color: white; box-sizing: border-box; color: #333333; font-family: questrial, sans-serif; font-size: 18px; margin-bottom: 26px; padding: 0px; text-align: justify;"&gt;
&lt;b&gt;&lt;u&gt;&lt;span style="box-sizing: border-box;"&gt;Analysis&lt;/span&gt;&lt;span style="box-sizing: border-box;"&gt;:&amp;nbsp;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;span style="font-weight: normal;"&gt;Below printf statement will ask the user to Enter an integer value to check whether it is Even or Odd.&lt;/span&gt;&lt;/h2&gt;
&lt;pre class="lang:c decode:true" style="background-color: #eeeeee; border-color: rgb(153, 153, 153) !important; border-style: solid !important; border-width: 1px !important; box-sizing: border-box; break-inside: avoid; color: purple !important; font-family: Monaco, monacoregular, &amp;quot;courier new&amp;quot;, monospace !important; font-size: 12px !important; line-height: 15px !important; max-width: 100%; overflow-wrap: break-word; overflow: auto; padding: 0px 5px; text-align: justify; text-shadow: none !important; white-space: pre-wrap;" title="C Program to Check Odd or Even using IF Condition"&gt;&lt;b&gt;printf(" Enter an int value to check Even or Odd \n ");&lt;/b&gt;
&lt;/pre&gt;
&lt;div style="background-color: white; box-sizing: border-box; color: #333333; font-family: questrial, sans-serif; font-size: 18px; margin-bottom: 26px; padding: 0px; text-align: justify;"&gt;
Below scanf statement will assign the user entered a value to number variable.&lt;/div&gt;
&lt;pre class="lang:c decode:true" style="background-color: #eeeeee; border-color: rgb(153, 153, 153) !important; border-style: solid !important; border-width: 1px !important; box-sizing: border-box; break-inside: avoid; color: purple !important; font-family: Monaco, monacoregular, &amp;quot;courier new&amp;quot;, monospace !important; font-size: 12px !important; line-height: 15px !important; max-width: 100%; overflow-wrap: break-word; overflow: auto; padding: 0px 5px; text-align: justify; text-shadow: none !important; white-space: pre-wrap;" title="C Program to Check Odd or Even using IF Condition"&gt;&lt;b&gt;scanf(" %d ",&amp;amp;number);&lt;/b&gt;
&lt;/pre&gt;
&lt;div style="background-color: white; box-sizing: border-box; color: #333333; font-family: questrial, sans-serif; font-size: 18px; margin-bottom: 26px; padding: 0px; text-align: justify;"&gt;
In the Next line, We declared the&amp;nbsp;&lt;a href="https://www.tutorialgateway.org/if-statement-in-c/" style="box-sizing: border-box; color: #de3233; text-decoration-line: none; transition: all 0.1s ease-in-out 0s;" title="If Statement in C"&gt;If statement&lt;/a&gt;&lt;span class="ezoic-adpicker-ad" id="ezoic-pub-ad-placeholder-125" style="box-sizing: border-box;"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre class="lang:c decode:true " style="background-color: #eeeeee; border-color: rgb(153, 153, 153) !important; border-style: solid !important; border-width: 1px !important; box-sizing: border-box; break-inside: avoid; color: purple !important; font-family: Monaco, monacoregular, &amp;quot;courier new&amp;quot;, monospace !important; font-size: 12px !important; line-height: 15px !important; max-width: 100%; overflow-wrap: break-word; overflow: auto; padding: 0px 5px; text-align: justify; text-shadow: none !important; white-space: pre-wrap;" title="C Program to Check Odd or Even using IF Condition"&gt;&lt;b&gt;if ( number % 2 == 0 )&lt;/b&gt;&lt;/pre&gt;
&lt;div style="background-color: white; box-sizing: border-box; color: #333333; font-family: questrial, sans-serif; font-size: 18px; margin-bottom: 26px; padding: 0px; text-align: justify;"&gt;
Any number that is completely divisible 2 is even number. If condition will check whether the remainder of the number divided by 2 is exactly equal to 0 or not.&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_SSkeNtapg3twKuiQY29vBTKaq7e9PNU8RcIpUbXoFPlzvx9E58bGF-3R2eqcQXVx5rHxD8GhtnJTnD_42rCSKEelA3xZCvGbhzxviNnzQDPyGme6Ja2nG4L-eF5NyZPgU7REHyNeknWJ/s1600/Screenshot_20190219_155610.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;span id="ezoic-pub-ad-placeholder-105" style="background-color: white; box-sizing: border-box; color: #333333; font-family: questrial, sans-serif; font-size: 18px; text-align: justify;"&gt;&lt;/span&gt;&lt;/a&gt;&lt;b&gt;&lt;u&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;ul style="background-color: white; box-sizing: border-box; color: #333333; font-family: questrial, sans-serif; font-size: 18px; margin: 0px 0px 26px 40px; padding: 0px; text-align: justify;"&gt;
&lt;li style="box-sizing: border-box; list-style-type: disc;"&gt;If the condition is True then it is Even number&lt;/li&gt;
&lt;li style="box-sizing: border-box; list-style-type: disc;"&gt;If the condition is False then it is Odd number&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
</description><link>https://tweetprogrammer.blogspot.com/2019/02/5-c-program-to-find-integer-for-even-or.html</link><author>noreply@blogger.com (Mohammad Saquib Khan)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj42Q9Thtejm25Zupi7WJ0czGH-OSQtOzMDst5Ta2O0WpasOudjwiJev7Tzq8nhkpeeZ1IGRzQM4Xn94ObiO3ZTPSHxO1gtToRczdXdF-aFTtTbZRd79OAMf8o1yHqaIEgutUG0w2LtupCI/s72-c/Screenshot_20190219_155640.png" width="72"/><thr:total>0</thr:total><georss:featurename>Prayagraj, Uttar Pradesh, India</georss:featurename><georss:point>25.4358011 81.846311000000014</georss:point><georss:box>25.2063056 81.523587500000019 25.665296599999998 82.169034500000009</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7867323827570382405.post-8644277530014076282</guid><pubDate>Tue, 19 Feb 2019 10:14:00 +0000</pubDate><atom:updated>2019-02-19T02:15:05.536-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Area</category><category domain="http://www.blogger.com/atom/ns#">Perimeter</category><category domain="http://www.blogger.com/atom/ns#">Triangle</category><title>#4: C Program To find The Perimeter and Area Of Triangle</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;b&gt;&lt;u&gt; Area &amp;amp; Perimeter Of Triangle&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;h3 style="background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;eb garamond&amp;quot;, serif; font-size: 24px; line-height: 1.2; margin: 0px 0px 16px; text-align: justify;"&gt;
C Program to find Area of a Triangle and Perimeter of a Triangle&lt;/h3&gt;
&lt;div style="background-color: white; box-sizing: border-box; color: #333333; font-family: questrial, sans-serif; font-size: 18px; margin-bottom: 26px; padding: 0px; text-align: justify;"&gt;
This&amp;nbsp;&lt;a href="https://www.tutorialgateway.org/c-programming-examples/" style="box-sizing: border-box; color: #de3233; text-decoration-line: none; transition: all 0.1s ease-in-out 0s;"&gt;program&lt;/a&gt;&amp;nbsp;for&amp;nbsp;area of triangle in c allows the user to enter three sides of the triangle. Using those values we will calculate the Perimeter of a triangle, Semi Perimeter of a triangle and then Area of a Triangle.&lt;/div&gt;
&lt;h3 style="background-color: white; box-sizing: border-box; color: #333333; font-family: questrial, sans-serif; font-size: 18px; margin-bottom: 26px; padding: 0px; text-align: justify;"&gt;
&lt;u&gt;Source Code:&lt;/u&gt;&lt;/h3&gt;
&lt;div&gt;
&lt;pre class="lang:c decode:true" style="background-color: #eeeeee; border-color: rgb(153, 153, 153) !important; border-style: solid !important; border-width: 1px !important; box-sizing: border-box; break-inside: avoid; color: purple !important; font-family: Monaco, monacoregular, &amp;quot;courier new&amp;quot;, monospace !important; font-size: 12px !important; line-height: 15px !important; max-width: 100%; overflow-wrap: break-word; overflow: auto; padding: 0px 5px; text-align: justify; text-shadow: none !important; white-space: pre-wrap;" title="C Program to find Area of a Triangle and Perimeter of a Triangle"&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;"&gt;/* C Program to find Area of a Triangle and Perimeter of a Triangle */

#include&amp;lt;stdio.h&amp;gt;
#include&amp;lt;math.h&amp;gt;

int main()
{
  float a, b, c, Perimeter, s, Area;
  
  printf("\nPlease Enter three sides of triangle\n");
  scanf("%f%f%f",&amp;amp;a,&amp;amp;b,&amp;amp;c);
   
  Perimeter = a+b+c;
  s = (a+b+c)/2;
  Area = sqrt(s*(s-a)*(s-b)*(s-c));
   
  printf("\n Perimeter of Traiangle = %.2f\n", Perimeter);
  printf("\n Semi Perimeter of Traiangle = %.2f\n",s);
  printf("\n Area of triangle = %.2f\n",Area);

  return 0;
}&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;h3 style="text-align: left;"&gt;
&lt;b&gt;&lt;u&gt;Output Console:&lt;/u&gt;&lt;/b&gt;&lt;/h3&gt;
&lt;h3 style="text-align: left;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5C0Dt0NxWah4-W1N3PT1fU75xLvtf_aTBs5lf52eE0OvqKgE-lM_nBZBZRKW6F-uq1DQDjUxSndhc6dFv3gRckTkbUWJiv1Kr5g8dHtOyodEWsYaw63A2cFR68YycWUdZQThwpkzQQmfb/s1600/Screenshot_20190219_153019.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em; text-align: center;"&gt;&lt;img border="0" data-original-height="396" data-original-width="531" height="148" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5C0Dt0NxWah4-W1N3PT1fU75xLvtf_aTBs5lf52eE0OvqKgE-lM_nBZBZRKW6F-uq1DQDjUxSndhc6dFv3gRckTkbUWJiv1Kr5g8dHtOyodEWsYaw63A2cFR68YycWUdZQThwpkzQQmfb/s200/Screenshot_20190219_153019.png" width="200" /&gt;&lt;/a&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqybqxWEY6GAAzVclvzFuU_dADVOpRTTdFz7L8zFK2GliuxXyBp8RDB2A0f474z4Yh7FZM_ZL3NtNzmTBhIAgJksw6_8bQ0x5WZ4nTTxckhDKd9ys1fJ05jzX19uR4dZxdkE7fzTkXdshR/s1600/Screenshot_20190219_153340.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"&gt;&lt;img border="0" data-original-height="595" data-original-width="522" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqybqxWEY6GAAzVclvzFuU_dADVOpRTTdFz7L8zFK2GliuxXyBp8RDB2A0f474z4Yh7FZM_ZL3NtNzmTBhIAgJksw6_8bQ0x5WZ4nTTxckhDKd9ys1fJ05jzX19uR4dZxdkE7fzTkXdshR/s200/Screenshot_20190219_153340.png" width="175" /&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="box-sizing: border-box; color: #333333; font-family: &amp;quot;questrial&amp;quot; , sans-serif; font-size: 18px; font-weight: 700; text-align: justify;"&gt;NOTE:&lt;/span&gt;&lt;span style="background-color: whitesmoke; color: #333333; font-family: &amp;quot;questrial&amp;quot; , sans-serif; font-size: 18px; text-align: justify;"&gt;&amp;nbsp;Please be careful while placing the open and close brackets, it may change the entire calculation if you place it wrong&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: white; box-sizing: border-box; color: #333333; font-size: 18px; text-align: justify;"&gt;&lt;u&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;georgia&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h3 style="text-align: left;"&gt;
&lt;span style="background-color: white; box-sizing: border-box; color: #333333; font-size: 18px; text-align: justify;"&gt;&lt;u&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;georgia&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;"&gt;Analysis&lt;/span&gt;&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;questrial&amp;quot; , sans-serif; font-size: 18px; font-weight: 700; text-align: justify;"&gt;:&lt;/span&gt;&lt;/h3&gt;
&lt;div&gt;
&lt;span style="background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;questrial&amp;quot; , sans-serif; font-size: 18px; font-weight: 700; text-align: justify;"&gt;Step 1:&lt;/span&gt;&lt;span style="background-color: white; color: #333333; font-family: &amp;quot;questrial&amp;quot; , sans-serif; font-size: 18px; text-align: justify;"&gt;&amp;nbsp;User will enter the three sides of the triangle a, b, c.&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;questrial&amp;quot; , sans-serif; font-size: 18px; font-weight: 700; text-align: justify;"&gt;Step 2:&lt;/span&gt;&lt;span style="background-color: white; color: #333333; font-family: &amp;quot;questrial&amp;quot; , sans-serif; font-size: 18px; text-align: justify;"&gt;&amp;nbsp;Calculating the Perimeter of Triangle using the formula P = a+b+c.&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;questrial&amp;quot; , sans-serif; font-size: 18px; font-weight: 700; text-align: justify;"&gt;Step 3:&lt;/span&gt;&lt;span style="background-color: white; color: #333333; font-family: &amp;quot;questrial&amp;quot; , sans-serif; font-size: 18px; text-align: justify;"&gt;&amp;nbsp;Calculating the semi perimeter using the formula (a+b+c)/2. Although we can write semi perimeter = (Perimeter/2) but we want show the formula behind. Thats why we used standard formula&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;questrial&amp;quot; , sans-serif; font-size: 18px; font-weight: 700; text-align: justify;"&gt;Step 4:&lt;/span&gt;&lt;span style="background-color: white; color: #333333; font-family: &amp;quot;questrial&amp;quot; , sans-serif; font-size: 18px; text-align: justify;"&gt;&amp;nbsp;Calculating the Area of a triangle using Heron’s Formula:&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: white; color: #333333; font-family: &amp;quot;questrial&amp;quot; , sans-serif; font-size: 18px; text-align: justify;"&gt;sqrt(s*(s-a)*(s-b)*(s-c));&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: white; color: #333333; font-family: &amp;quot;questrial&amp;quot; , sans-serif; font-size: 18px; text-align: justify;"&gt;sqrt() is the math function, which is used to calculate the square root.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</description><link>https://tweetprogrammer.blogspot.com/2019/02/4-c-program-to-find-perimeter-and-area.html</link><author>noreply@blogger.com (Mohammad Saquib Khan)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5C0Dt0NxWah4-W1N3PT1fU75xLvtf_aTBs5lf52eE0OvqKgE-lM_nBZBZRKW6F-uq1DQDjUxSndhc6dFv3gRckTkbUWJiv1Kr5g8dHtOyodEWsYaw63A2cFR68YycWUdZQThwpkzQQmfb/s72-c/Screenshot_20190219_153019.png" width="72"/><thr:total>0</thr:total><georss:featurename>Prayagraj, Uttar Pradesh, India</georss:featurename><georss:point>25.4358011 81.846311000000014</georss:point><georss:box>25.2063056 81.523587500000019 25.665296599999998 82.169034500000009</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7867323827570382405.post-271240340338201202</guid><pubDate>Mon, 18 Feb 2019 09:28:00 +0000</pubDate><atom:updated>2019-02-18T01:28:26.624-08:00</atom:updated><title>Source Code Compilation</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;b&gt;Hello everyone...&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;This is Mohammad Saquib khan and i want to tell you that all the source codes for my programs can run only on the following C_Programming Compilers:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;&lt;b&gt;&lt;u&gt;Code_Blocks&lt;/u&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;u&gt;cppdroid(Android Compiler)&amp;nbsp;&lt;/u&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;u&gt;Ubuntu(GCC Compiler)&lt;/u&gt;&amp;nbsp;&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;b&gt;You can Download these Compilers&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;The links are given below..&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;a href="https://filehippo.com/download_codeblocks/" target="_blank"&gt;&lt;b style="background-color: #eeeeee;"&gt;https://filehippo.com/download_codeblocks/&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;&lt;a href="https://m.apkpure.com/cppdroid-c-c-ide/name.antonsmirnov.android.cppdroid" style="background-color: #eeeeee;" target="_blank"&gt;https://m.apkpure.com/cppdroid-c-c-ide/name.antonsmirnov.android.cppdroid&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Thank you.!&lt;/b&gt;!&amp;nbsp;&lt;/div&gt;
</description><link>https://tweetprogrammer.blogspot.com/2019/02/source-code-compilation.html</link><author>noreply@blogger.com (Mohammad Saquib Khan)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7867323827570382405.post-5778609427200141458</guid><pubDate>Mon, 18 Feb 2019 08:17:00 +0000</pubDate><atom:updated>2019-02-18T00:17:49.432-08:00</atom:updated><title>#3: C Program To find out the Simple Interest Given Principal, Rate &amp; Time</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;h2 style="text-align: left;"&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;b&gt;&lt;u style="background-color: #cccccc;"&gt;Simple Interest.&lt;/u&gt;&lt;/b&gt;&lt;/h2&gt;
&lt;u&gt;&lt;b style="background-color: #cccccc;"&gt;Source Code:&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
&lt;b style="background-color: #eeeeee;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;/**&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style="background-color: #eeeeee;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp;* C program to calculate simple interest&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style="background-color: #eeeeee;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp;*/&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style="background-color: #eeeeee;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style="background-color: #eeeeee;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;int main()&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style="background-color: #eeeeee;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;{&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style="background-color: #eeeeee;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; float principle, time, rate, SI;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style="background-color: #eeeeee;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b style="background-color: #eeeeee;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; /* Input principle, rate and time */&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style="background-color: #eeeeee;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; printf("Enter principle (amount):\n ");&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style="background-color: #eeeeee;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; scanf("%f", &amp;amp;principle);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style="background-color: #eeeeee;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b style="background-color: #eeeeee;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; printf("Enter time:\n");&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style="background-color: #eeeeee;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; scanf("%f", &amp;amp;time);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style="background-color: #eeeeee;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b style="background-color: #eeeeee;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; printf("Enter rate:\n");&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style="background-color: #eeeeee;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; scanf("%f", &amp;amp;rate);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style="background-color: #eeeeee;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b style="background-color: #eeeeee;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; /* Calculate simple interest */&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style="background-color: #eeeeee;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; SI = (principle * time * rate) / 100;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style="background-color: #eeeeee;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b style="background-color: #eeeeee;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; /* Print the resultant value of SI */&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style="background-color: #eeeeee;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; printf("Simple Interest = %f", SI);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style="background-color: #eeeeee;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; return 0;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b style="background-color: #eeeeee;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;}&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style="background-color: white;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style="background-color: white;"&gt;&amp;nbsp;&lt;/span&gt;&lt;u style="background-color: #cccccc;"&gt;Output Console:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u style="background-color: #cccccc;"&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoE41W1st8wmFxWCUc8xD-yDrmVYyw3pdp7Uj5z5y6Z4R8FhvJf4hQH8xGxxCZ0DtzM8KHrFf6nIu75gdNpaelOfFXGKjLK3cZyvGTc6uSaFW8Zjj4rTFVCYqzMxTuMjbbLSo8NbtLWIDe/s1600/Screenshot_20190218_133146.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em; text-align: center;"&gt;&lt;img border="0" data-original-height="278" data-original-width="353" height="157" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoE41W1st8wmFxWCUc8xD-yDrmVYyw3pdp7Uj5z5y6Z4R8FhvJf4hQH8xGxxCZ0DtzM8KHrFf6nIu75gdNpaelOfFXGKjLK3cZyvGTc6uSaFW8Zjj4rTFVCYqzMxTuMjbbLSo8NbtLWIDe/s200/Screenshot_20190218_133146.png" width="200" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;&lt;u style="background-color: #cccccc;"&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;
&lt;b&gt;&lt;u style="background-color: #cccccc;"&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;
&lt;b&gt;&lt;u style="background-color: #cccccc;"&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;
&lt;b&gt;&lt;u style="background-color: #cccccc;"&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;
&lt;b&gt;&lt;u style="background-color: #cccccc;"&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;
&lt;u&gt;&lt;b style="background-color: #cccccc;"&gt;Logic:&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
&lt;div style="-webkit-font-smoothing: antialiased; background-color: white; box-sizing: border-box; color: #121213; text-align: justify;"&gt;
&lt;span style="font-family: Georgia, Times New Roman, serif;"&gt;Step by step descriptive logic to calculate simple interest.&lt;/span&gt;&lt;/div&gt;
&lt;ol style="-webkit-font-smoothing: antialiased; background-color: white; box-sizing: border-box; color: #121213; font-size: 16px; margin: 16px 0px; padding: 0px 0px 0px 40px; text-align: justify;"&gt;
&lt;li style="-webkit-font-smoothing: antialiased; box-sizing: border-box; margin: 5px 0px;"&gt;&lt;span style="font-family: Georgia, Times New Roman, serif;"&gt;Input principle amount in some variable say&amp;nbsp;&lt;var style="-webkit-font-smoothing: antialiased; background-color: #eaeaea; border-radius: 1px; box-sizing: border-box; display: inline-block; font-size: 14.4px; font-style: normal; margin: 3px; padding: 0px 4px;"&gt;principle&lt;/var&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li style="-webkit-font-smoothing: antialiased; box-sizing: border-box; margin: 5px 0px;"&gt;&lt;span style="font-family: Georgia, Times New Roman, serif;"&gt;Input time in some variable say&amp;nbsp;&lt;var style="-webkit-font-smoothing: antialiased; background-color: #eaeaea; border-radius: 1px; box-sizing: border-box; display: inline-block; font-size: 14.4px; font-style: normal; margin: 3px; padding: 0px 4px;"&gt;time&lt;/var&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li style="-webkit-font-smoothing: antialiased; box-sizing: border-box; margin: 5px 0px;"&gt;&lt;span style="font-family: Georgia, Times New Roman, serif;"&gt;Input rate in some variable say&amp;nbsp;&lt;var style="-webkit-font-smoothing: antialiased; background-color: #eaeaea; border-radius: 1px; box-sizing: border-box; display: inline-block; font-size: 14.4px; font-style: normal; margin: 3px; padding: 0px 4px;"&gt;rate&lt;/var&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li style="-webkit-font-smoothing: antialiased; box-sizing: border-box; margin: 5px 0px;"&gt;&lt;span style="font-family: Georgia, Times New Roman, serif;"&gt;Find simple interest using formula&amp;nbsp;&lt;code style="-webkit-font-smoothing: antialiased; background-color: #eaeaea; border-radius: 1px; box-sizing: border-box; display: inline-block; font-size: 14.4px; hyphens: none; margin: 3px; padding: 0px 4px;"&gt;SI = (principle * time * rate) / 100&lt;/code&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li style="-webkit-font-smoothing: antialiased; box-sizing: border-box; margin: 5px 0px;"&gt;&lt;span style="font-family: Georgia, Times New Roman, serif;"&gt;Finally, print the resultant value of&amp;nbsp;&lt;var style="-webkit-font-smoothing: antialiased; background-color: #eaeaea; border-radius: 1px; box-sizing: border-box; display: inline-block; font-size: 14.4px; font-style: normal; margin: 3px; padding: 0px 4px;"&gt;SI&lt;/var&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
</description><link>https://tweetprogrammer.blogspot.com/2019/02/3-c-program-to-find-out-simple-interest.html</link><author>noreply@blogger.com (Mohammad Saquib Khan)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoE41W1st8wmFxWCUc8xD-yDrmVYyw3pdp7Uj5z5y6Z4R8FhvJf4hQH8xGxxCZ0DtzM8KHrFf6nIu75gdNpaelOfFXGKjLK3cZyvGTc6uSaFW8Zjj4rTFVCYqzMxTuMjbbLSo8NbtLWIDe/s72-c/Screenshot_20190218_133146.png" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7867323827570382405.post-5113084087224849718</guid><pubDate>Mon, 18 Feb 2019 07:44:00 +0000</pubDate><atom:updated>2019-02-17T23:50:23.846-08:00</atom:updated><title>#2: C Program To Calculate substraction Of two Numbers</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;u&gt;&lt;b style="background-color: #cccccc;"&gt;Substraction of Two Numbers:&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: &amp;quot;georgia&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;"&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;b&gt;&lt;u&gt;SOURCE CODE&lt;span style="font-size: x-small;"&gt;:&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style="font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;"&gt;#include&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style="font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;"&gt;int main()&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style="font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;"&gt;{&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style="font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;"&gt;&amp;nbsp; &amp;nbsp; int a,b,c;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style="font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;"&gt;&amp;nbsp; &amp;nbsp; printf("Enter the numbers to subtract them:\n");&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style="font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;"&gt;&amp;nbsp; &amp;nbsp; scanf("%d%d", &amp;amp;a, &amp;amp;b);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style="font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;"&gt;&amp;nbsp; &amp;nbsp; c=a-b;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style="font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;"&gt;&amp;nbsp; &amp;nbsp; printf("Subtraction of the two numbers is:=%d\n",c);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style="font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;"&gt;&amp;nbsp; &amp;nbsp; return 0;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style="font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style="font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&amp;nbsp;&lt;u&gt;OUTPUT CONSOLE:&lt;/u&gt;&lt;/b&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIqzcOUS2GkE5zeuo1zaHduJduC7Cv3o3kaZwKdR8-vscZiB-7Hs8a8VzhBGk58mYWufDEku4ZVLz54RCvklDZsrm5O1dYbX-Ccy73O74cd6crLB5x5bgFc1EYMroBnYYdlZr1Oqeje1lN/s1600/Screenshot_20190218_130331.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"&gt;&lt;img border="0" data-original-height="228" data-original-width="417" height="174" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIqzcOUS2GkE5zeuo1zaHduJduC7Cv3o3kaZwKdR8-vscZiB-7Hs8a8VzhBGk58mYWufDEku4ZVLz54RCvklDZsrm5O1dYbX-Ccy73O74cd6crLB5x5bgFc1EYMroBnYYdlZr1Oqeje1lN/s320/Screenshot_20190218_130331.png" width="320" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
</description><link>https://tweetprogrammer.blogspot.com/2019/02/2-c-program-to-calculate-substraction.html</link><author>noreply@blogger.com (Mohammad Saquib Khan)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIqzcOUS2GkE5zeuo1zaHduJduC7Cv3o3kaZwKdR8-vscZiB-7Hs8a8VzhBGk58mYWufDEku4ZVLz54RCvklDZsrm5O1dYbX-Ccy73O74cd6crLB5x5bgFc1EYMroBnYYdlZr1Oqeje1lN/s72-c/Screenshot_20190218_130331.png" width="72"/><thr:total>0</thr:total><georss:featurename>Prayagraj, Uttar Pradesh, India</georss:featurename><georss:point>25.4358011 81.846311000000014</georss:point><georss:box>25.2063056 81.523587500000019 25.665296599999998 82.169034500000009</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7867323827570382405.post-4673437890934497092</guid><pubDate>Sun, 17 Feb 2019 22:42:00 +0000</pubDate><atom:updated>2019-02-17T15:10:24.805-08:00</atom:updated><title>#1: C Program To find The sum of Two Numbers</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;span style="font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;"&gt;&lt;span style="background-color: #f3f3f3;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;b&gt;Addition of Two Numbers.&lt;/b&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;b&gt;&amp;nbsp;&lt;u&gt;&lt;span style="background-color: #cccccc; font-family: &amp;quot;georgia&amp;quot; , &amp;quot;times new roman&amp;quot; , serif; font-size: x-small;"&gt;Source code:&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;table class="crayon-table" style="background-color: white; background-image: none; border-collapse: collapse; border-spacing: 0px; border: none; box-sizing: border-box; color: black; font-family: &amp;quot;liberation mono&amp;quot;, liberationmonoregular, &amp;quot;courier new&amp;quot;, monospace; margin: 0px 0px 0px -27px; padding: 0px; table-layout: auto; width: auto;"&gt;&lt;tbody style="box-sizing: border-box;"&gt;
&lt;tr class="crayon-row" style="background: 0px center; border: none !important; box-sizing: border-box; margin: 0px !important; padding: 0px !important; vertical-align: top !important;"&gt;&lt;td class="crayon-nums " data-settings="hide" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 3px solid rgb(108, 226, 108) !important; border-top: 0px; box-sizing: border-box; color: rgb(175, 175, 175) !important; margin: 0px !important; padding: 0px 5px 0px 0px !important; vertical-align: top !important;"&gt;&lt;div class="crayon-nums-content" style="background: 0px center; border: 0px; box-sizing: border-box; line-height: 20px; margin: 0px; padding: 0px; white-space: nowrap;"&gt;
&lt;div class="crayon-num crayon-striped-num" data-line="crayon-5c68dfd5e0554058502622-2" style="background: 0px center; border: 0px; box-sizing: border-box; font-family: inherit; height: inherit; line-height: inherit; margin: 0px; padding: 0px 5px; text-align: center;"&gt;
&lt;b&gt;1&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;td class="crayon-code" style="background: 0px center; border: 0px; box-sizing: border-box; margin: 0px !important; padding: 0px !important; vertical-align: top !important; width: 332.667px;"&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="crayon-table" style="background-attachment: initial !important; background-clip: initial !important; background-color: white; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-collapse: collapse !important; border-spacing: 0px !important; border: none !important; box-sizing: border-box; color: black; font-family: &amp;quot;Liberation Mono&amp;quot;, LiberationMonoRegular, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; margin-bottom: 0px !important; margin-left: -27px; margin-right: 0px !important; margin-top: 0px !important; padding: 0px !important; table-layout: auto !important; width: auto !important;"&gt;&lt;tbody style="box-sizing: border-box;"&gt;
&lt;tr class="crayon-row" style="background: 0px center; border: none !important; box-sizing: border-box; margin: 0px !important; padding: 0px !important; vertical-align: top !important;"&gt;&lt;td class="crayon-nums " data-settings="hide" style="background: 0px center; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 3px solid rgb(108, 226, 108) !important; border-top: 0px; box-sizing: border-box; color: rgb(175, 175, 175) !important; margin: 0px !important; padding: 0px 5px 0px 0px !important; vertical-align: top !important;"&gt;&lt;div class="crayon-nums-content" style="background: 0px center; border: 0px; box-sizing: border-box; line-height: 20px !important; margin: 0px; padding: 0px; white-space: nowrap;"&gt;
&lt;div class="crayon-num crayon-striped-num" data-line="crayon-5c68dfd5e0554058502622-2" style="background: 0px center; border: 0px; box-sizing: border-box; font-family: inherit; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; text-align: center;"&gt;
&lt;b&gt;&lt;span style="font-size: small;"&gt;2&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5c68dfd5e0554058502622-3" style="background: 0px center; border: 0px; box-sizing: border-box; font-family: inherit; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; text-align: center;"&gt;
&lt;b&gt;&lt;span style="font-size: small;"&gt;3&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class="crayon-num crayon-striped-num" data-line="crayon-5c68dfd5e0554058502622-4" style="background: 0px center; border: 0px; box-sizing: border-box; font-family: inherit; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; text-align: center;"&gt;
&lt;b&gt;&lt;span style="font-size: small;"&gt;4&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5c68dfd5e0554058502622-5" style="background: 0px center; border: 0px; box-sizing: border-box; font-family: inherit; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; text-align: center;"&gt;
&lt;b&gt;&lt;span style="font-size: small;"&gt;5&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class="crayon-num crayon-striped-num" data-line="crayon-5c68dfd5e0554058502622-6" style="background: 0px center; border: 0px; box-sizing: border-box; font-family: inherit; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; text-align: center;"&gt;
&lt;b&gt;&lt;span style="font-size: small;"&gt;6&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5c68dfd5e0554058502622-7" style="background: 0px center; border: 0px; box-sizing: border-box; font-family: inherit; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; text-align: center;"&gt;
&lt;b&gt;&lt;span style="font-size: small;"&gt;7&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class="crayon-num crayon-striped-num" data-line="crayon-5c68dfd5e0554058502622-8" style="background: 0px center; border: 0px; box-sizing: border-box; font-family: inherit; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; text-align: center;"&gt;
&lt;b&gt;&lt;span style="font-size: small;"&gt;8&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5c68dfd5e0554058502622-9" style="background: 0px center; border: 0px; box-sizing: border-box; font-family: inherit; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; text-align: center;"&gt;
&lt;b&gt;&lt;span style="font-size: small;"&gt;9&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class="crayon-num crayon-striped-num" data-line="crayon-5c68dfd5e0554058502622-10" style="background: 0px center; border: 0px; box-sizing: border-box; font-family: inherit; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; text-align: center;"&gt;
&lt;b&gt;&lt;span style="font-size: small;"&gt;10&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class="crayon-num" data-line="crayon-5c68dfd5e0554058502622-11" style="background: 0px center; border: 0px; box-sizing: border-box; font-family: inherit; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; text-align: center;"&gt;
&lt;b&gt;&lt;span style="font-size: small;"&gt;11&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;td class="crayon-code" style="background: 0px center; border: 0px; box-sizing: border-box; margin: 0px !important; padding: 0px !important; vertical-align: top !important; width: 332.667px;"&gt;&lt;div class="crayon-pre" style="background: none !important; border: none !important; box-sizing: border-box; line-height: 20px !important; margin: 0px; overflow: visible; padding: 0px; tab-size: 4; white-space: pre;"&gt;
&lt;div class="crayon-line" id="crayon-5c68dfd5e0554058502622-1" style="background: 0px center; border: 0px; box-sizing: border-box; font-family: inherit; height: inherit; line-height: inherit !important; margin: 0px; padding-bottom: 0px; padding-left: 10px !important; padding-right: 5px; padding-top: 0px;"&gt;
&lt;span class="crayon-p" style="box-sizing: border-box; color: rgb(184 , 92 , 0); font-family: inherit; height: inherit; line-height: inherit;"&gt;&lt;b&gt;&lt;span style="font-size: small;"&gt;#include&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="crayon-line crayon-striped-line" id="crayon-5c68dfd5e0554058502622-2" style="background: rgb(249, 249, 249) !important; border: 0px; box-sizing: border-box; font-family: inherit; height: inherit; line-height: inherit !important; margin: 0px; padding-bottom: 0px; padding-left: 10px !important; padding-right: 5px; padding-top: 0px;"&gt;
&lt;b&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&lt;span class="crayon-t" style="box-sizing: border-box; color: rgb(128 , 0 , 128); font-family: inherit; height: inherit; line-height: inherit;"&gt;int&lt;/span&gt;&lt;span class="crayon-h" style="box-sizing: border-box; color: rgb(0 , 111 , 224); font-family: inherit; height: inherit; line-height: inherit;"&gt; &lt;/span&gt;&lt;span class="crayon-e" style="box-sizing: border-box; color: rgb(0 , 78 , 208); font-family: inherit; height: inherit; line-height: inherit;"&gt;main&lt;/span&gt;&lt;span class="crayon-sy" style="box-sizing: border-box; color: rgb(51 , 51 , 51); font-family: inherit; height: inherit; line-height: inherit;"&gt;(&lt;/span&gt;&lt;span class="crayon-sy" style="box-sizing: border-box; color: rgb(51 , 51 , 51); font-family: inherit; height: inherit; line-height: inherit;"&gt;)&lt;/span&gt;&lt;span class="crayon-h" style="box-sizing: border-box; color: rgb(0 , 111 , 224); font-family: inherit; height: inherit; line-height: inherit;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class="crayon-line crayon-striped-line" id="crayon-5c68dfd5e0554058502622-2" style="background: rgb(249, 249, 249) !important; border: 0px; box-sizing: border-box; font-family: inherit; height: inherit; line-height: inherit !important; margin: 0px; padding-bottom: 0px; padding-left: 10px !important; padding-right: 5px; padding-top: 0px;"&gt;
&lt;span class="crayon-sy" style="box-sizing: border-box; color: rgb(51 , 51 , 51); font-family: inherit; height: inherit; line-height: inherit;"&gt;&lt;b&gt;&lt;span style="font-size: small;"&gt; {&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="crayon-line crayon-striped-line" id="crayon-5c68dfd5e0554058502622-4" style="background: rgb(249, 249, 249) !important; border: 0px; box-sizing: border-box; font-family: inherit; height: inherit; line-height: inherit !important; margin: 0px; padding-bottom: 0px; padding-left: 10px !important; padding-right: 5px; padding-top: 0px;"&gt;
&lt;b&gt;&lt;span style="font-size: small;"&gt;&lt;span class="crayon-h" style="box-sizing: border-box; color: rgb(0 , 111 , 224); font-family: inherit; height: inherit; line-height: inherit;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span class="crayon-t" style="box-sizing: border-box; color: rgb(128 , 0 , 128); font-family: inherit; height: inherit; line-height: inherit;"&gt;int&lt;/span&gt;&lt;span class="crayon-h" style="box-sizing: border-box; color: rgb(0 , 111 , 224); font-family: inherit; height: inherit; line-height: inherit;"&gt; &lt;/span&gt;&lt;span class="crayon-v" style="box-sizing: border-box; color: rgb(0 , 45 , 122); font-family: inherit; height: inherit; line-height: inherit;"&gt;a&lt;/span&gt;&lt;span class="crayon-sy" style="box-sizing: border-box; color: rgb(51 , 51 , 51); font-family: inherit; height: inherit; line-height: inherit;"&gt;,&lt;/span&gt;&lt;span class="crayon-h" style="box-sizing: border-box; color: rgb(0 , 111 , 224); font-family: inherit; height: inherit; line-height: inherit;"&gt; &lt;/span&gt;&lt;span class="crayon-v" style="box-sizing: border-box; color: rgb(0 , 45 , 122); font-family: inherit; height: inherit; line-height: inherit;"&gt;b&lt;/span&gt;&lt;span class="crayon-sy" style="box-sizing: border-box; color: rgb(51 , 51 , 51); font-family: inherit; height: inherit; line-height: inherit;"&gt;,&lt;/span&gt;&lt;span class="crayon-h" style="box-sizing: border-box; color: rgb(0 , 111 , 224); font-family: inherit; height: inherit; line-height: inherit;"&gt; &lt;/span&gt;&lt;span class="crayon-v" style="box-sizing: border-box; color: rgb(0 , 45 , 122); font-family: inherit; height: inherit; line-height: inherit;"&gt;sum&lt;/span&gt;&lt;span class="crayon-sy" style="box-sizing: border-box; color: rgb(51 , 51 , 51); font-family: inherit; height: inherit; line-height: inherit;"&gt;;&lt;/span&gt;&lt;span style="background-color: initial; font-family: inherit;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class="crayon-line crayon-striped-line" id="crayon-5c68dfd5e0554058502622-6" style="background: rgb(249, 249, 249) !important; border: 0px; box-sizing: border-box; font-family: inherit; height: inherit; line-height: inherit !important; margin: 0px; padding-bottom: 0px; padding-left: 10px !important; padding-right: 5px; padding-top: 0px;"&gt;
&lt;b&gt;&lt;span style="font-size: small;"&gt;&lt;span class="crayon-h" style="box-sizing: border-box; color: rgb(0 , 111 , 224); font-family: inherit; height: inherit; line-height: inherit;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span class="crayon-e" style="box-sizing: border-box; color: rgb(0 , 78 , 208); font-family: inherit; height: inherit; line-height: inherit;"&gt;printf&lt;/span&gt;&lt;span class="crayon-sy" style="box-sizing: border-box; color: rgb(51 , 51 , 51); font-family: inherit; height: inherit; line-height: inherit;"&gt;(&lt;/span&gt;&lt;span class="crayon-s" style="box-sizing: border-box; color: rgb(0 , 128 , 0); font-family: inherit; height: inherit; line-height: inherit;"&gt;"\nEnter two no: "&lt;/span&gt;&lt;span class="crayon-sy" style="box-sizing: border-box; color: rgb(51 , 51 , 51); font-family: inherit; height: inherit; line-height: inherit;"&gt;)&lt;/span&gt;&lt;span class="crayon-sy" style="box-sizing: border-box; color: rgb(51 , 51 , 51); font-family: inherit; height: inherit; line-height: inherit;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class="crayon-line" id="crayon-5c68dfd5e0554058502622-7" style="background: 0px center; border: 0px; box-sizing: border-box; font-family: inherit; height: inherit; line-height: inherit !important; margin: 0px; padding-bottom: 0px; padding-left: 10px !important; padding-right: 5px; padding-top: 0px;"&gt;
&lt;b&gt;&lt;span style="font-size: small;"&gt;&lt;span class="crayon-h" style="box-sizing: border-box; color: rgb(0 , 111 , 224); font-family: inherit; height: inherit; line-height: inherit;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span class="crayon-e" style="box-sizing: border-box; color: rgb(0 , 78 , 208); font-family: inherit; height: inherit; line-height: inherit;"&gt;scanf&lt;/span&gt;&lt;span class="crayon-sy" style="box-sizing: border-box; color: rgb(51 , 51 , 51); font-family: inherit; height: inherit; line-height: inherit;"&gt;(&lt;/span&gt;&lt;span class="crayon-s" style="box-sizing: border-box; color: rgb(0 , 128 , 0); font-family: inherit; height: inherit; line-height: inherit;"&gt;"%d %d"&lt;/span&gt;&lt;span class="crayon-sy" style="box-sizing: border-box; color: rgb(51 , 51 , 51); font-family: inherit; height: inherit; line-height: inherit;"&gt;,&lt;/span&gt;&lt;span class="crayon-h" style="box-sizing: border-box; color: rgb(0 , 111 , 224); font-family: inherit; height: inherit; line-height: inherit;"&gt; &lt;/span&gt;&lt;span class="crayon-o" style="box-sizing: border-box; color: rgb(0 , 111 , 224); font-family: inherit; height: inherit; line-height: inherit;"&gt;&amp;amp;&lt;/span&gt;&lt;span class="crayon-v" style="box-sizing: border-box; color: rgb(0 , 45 , 122); font-family: inherit; height: inherit; line-height: inherit;"&gt;a&lt;/span&gt;&lt;span class="crayon-sy" style="box-sizing: border-box; color: rgb(51 , 51 , 51); font-family: inherit; height: inherit; line-height: inherit;"&gt;,&lt;/span&gt;&lt;span class="crayon-h" style="box-sizing: border-box; color: rgb(0 , 111 , 224); font-family: inherit; height: inherit; line-height: inherit;"&gt; &lt;/span&gt;&lt;span class="crayon-o" style="box-sizing: border-box; color: rgb(0 , 111 , 224); font-family: inherit; height: inherit; line-height: inherit;"&gt;&amp;amp;&lt;/span&gt;&lt;span class="crayon-v" style="box-sizing: border-box; color: rgb(0 , 45 , 122); font-family: inherit; height: inherit; line-height: inherit;"&gt;b&lt;/span&gt;&lt;span class="crayon-sy" style="box-sizing: border-box; color: rgb(51 , 51 , 51); font-family: inherit; height: inherit; line-height: inherit;"&gt;)&lt;/span&gt;&lt;span class="crayon-sy" style="box-sizing: border-box; color: rgb(51 , 51 , 51); font-family: inherit; height: inherit; line-height: inherit;"&gt;;&lt;/span&gt;&lt;span style="background-color: #f9f9f9; font-family: inherit;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class="crayon-line" id="crayon-5c68dfd5e0554058502622-9" style="background: 0px center; border: 0px; box-sizing: border-box; font-family: inherit; height: inherit; line-height: inherit !important; margin: 0px; padding-bottom: 0px; padding-left: 10px !important; padding-right: 5px; padding-top: 0px;"&gt;
&lt;b&gt;&lt;span style="font-size: small;"&gt;&lt;span class="crayon-h" style="box-sizing: border-box; color: rgb(0 , 111 , 224); font-family: inherit; height: inherit; line-height: inherit;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span class="crayon-v" style="box-sizing: border-box; color: rgb(0 , 45 , 122); font-family: inherit; height: inherit; line-height: inherit;"&gt;sum&lt;/span&gt;&lt;span class="crayon-h" style="box-sizing: border-box; color: rgb(0 , 111 , 224); font-family: inherit; height: inherit; line-height: inherit;"&gt; &lt;/span&gt;&lt;span class="crayon-o" style="box-sizing: border-box; color: rgb(0 , 111 , 224); font-family: inherit; height: inherit; line-height: inherit;"&gt;=&lt;/span&gt;&lt;span class="crayon-h" style="box-sizing: border-box; color: rgb(0 , 111 , 224); font-family: inherit; height: inherit; line-height: inherit;"&gt; &lt;/span&gt;&lt;span class="crayon-v" style="box-sizing: border-box; color: rgb(0 , 45 , 122); font-family: inherit; height: inherit; line-height: inherit;"&gt;a&lt;/span&gt;&lt;span class="crayon-h" style="box-sizing: border-box; color: rgb(0 , 111 , 224); font-family: inherit; height: inherit; line-height: inherit;"&gt; &lt;/span&gt;&lt;span class="crayon-o" style="box-sizing: border-box; color: rgb(0 , 111 , 224); font-family: inherit; height: inherit; line-height: inherit;"&gt;+&lt;/span&gt;&lt;span class="crayon-h" style="box-sizing: border-box; color: rgb(0 , 111 , 224); font-family: inherit; height: inherit; line-height: inherit;"&gt; &lt;/span&gt;&lt;span class="crayon-h" style="box-sizing: border-box; font-family: inherit; height: inherit; line-height: inherit;"&gt;&lt;span style="color: #002d7a;"&gt;b;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class="crayon-line" id="crayon-5c68dfd5e0554058502622-11" style="background: 0px center; border: 0px; box-sizing: border-box; font-family: inherit; height: inherit; line-height: inherit !important; margin: 0px; padding-bottom: 0px; padding-left: 10px !important; padding-right: 5px; padding-top: 0px;"&gt;
&lt;b&gt;&lt;span style="font-size: small;"&gt;&lt;span class="crayon-h" style="box-sizing: border-box; color: rgb(0 , 111 , 224); font-family: inherit; height: inherit; line-height: inherit;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span class="crayon-e" style="box-sizing: border-box; color: rgb(0 , 78 , 208); font-family: inherit; height: inherit; line-height: inherit;"&gt;printf&lt;/span&gt;&lt;span class="crayon-sy" style="box-sizing: border-box; color: rgb(51 , 51 , 51); font-family: inherit; height: inherit; line-height: inherit;"&gt;(&lt;/span&gt;&lt;span class="crayon-s" style="box-sizing: border-box; color: rgb(0 , 128 , 0); font-family: inherit; height: inherit; line-height: inherit;"&gt;"Sum : %d"&lt;/span&gt;&lt;span class="crayon-sy" style="box-sizing: border-box; color: rgb(51 , 51 , 51); font-family: inherit; height: inherit; line-height: inherit;"&gt;,&lt;/span&gt;&lt;span class="crayon-h" style="box-sizing: border-box; color: rgb(0 , 111 , 224); font-family: inherit; height: inherit; line-height: inherit;"&gt; &lt;/span&gt;&lt;span class="crayon-v" style="box-sizing: border-box; color: rgb(0 , 45 , 122); font-family: inherit; height: inherit; line-height: inherit;"&gt;sum&lt;/span&gt;&lt;span class="crayon-sy" style="box-sizing: border-box; color: rgb(51 , 51 , 51); font-family: inherit; height: inherit; line-height: inherit;"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class="crayon-line" id="crayon-5c68dfd5e0554058502622-13" style="background: 0px center; border: 0px; box-sizing: border-box; font-family: inherit; height: inherit; line-height: inherit !important; margin: 0px; padding-bottom: 0px; padding-left: 10px !important; padding-right: 5px; padding-top: 0px;"&gt;
&lt;b&gt;&lt;span style="font-size: small;"&gt;&lt;span class="crayon-h" style="box-sizing: border-box; color: rgb(0 , 111 , 224); font-family: inherit; height: inherit; line-height: inherit;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span class="crayon-st" style="box-sizing: border-box; color: rgb(128 , 0 , 128); font-family: inherit; height: inherit; line-height: inherit;"&gt;return&lt;/span&gt;&lt;span class="crayon-sy" style="box-sizing: border-box; color: rgb(51 , 51 , 51); font-family: inherit; height: inherit; line-height: inherit;"&gt;(&lt;/span&gt;&lt;span class="crayon-cn" style="box-sizing: border-box; color: rgb(206 , 0 , 0); font-family: inherit; height: inherit; line-height: inherit;"&gt;0&lt;/span&gt;&lt;span class="crayon-sy" style="box-sizing: border-box; color: rgb(51 , 51 , 51); font-family: inherit; height: inherit; line-height: inherit;"&gt;)&lt;/span&gt;&lt;span class="crayon-sy" style="box-sizing: border-box; color: rgb(51 , 51 , 51); font-family: inherit; height: inherit; line-height: inherit;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class="crayon-line crayon-striped-line" id="crayon-5c68dfd5e0554058502622-14" style="background: rgb(249, 249, 249) !important; border: 0px; box-sizing: border-box; font-family: inherit; height: inherit; line-height: inherit !important; margin: 0px; padding-bottom: 0px; padding-left: 10px !important; padding-right: 5px; padding-top: 0px;"&gt;
&lt;span class="crayon-sy" style="box-sizing: border-box; color: rgb(51 , 51 , 51); font-family: inherit; height: inherit; line-height: inherit;"&gt;&lt;b&gt;&lt;span style="font-size: small;"&gt;}&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;u&gt;&lt;b&gt;Output Console&lt;/b&gt;&lt;/u&gt;:&lt;br /&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuzwXM9gFmrpHFUsHJ_EaP0meRvTRnb6GCDELgkPTW3dHrNWec08tSPtp4Xly0YBIb14tZD1wxrqm3LKDDje4tLGDrSUxnkZKDU26_QEG_kBeglR1CFGi1Kizmpzii48wKhseCgV2N-WJZ/s1600/Screenshot_20190218_032845.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"&gt;&lt;img border="0" data-original-height="146" data-original-width="503" height="92" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuzwXM9gFmrpHFUsHJ_EaP0meRvTRnb6GCDELgkPTW3dHrNWec08tSPtp4Xly0YBIb14tZD1wxrqm3LKDDje4tLGDrSUxnkZKDU26_QEG_kBeglR1CFGi1Kizmpzii48wKhseCgV2N-WJZ/s320/Screenshot_20190218_032845.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span id="goog_1690910358"&gt;&lt;/span&gt;&lt;span id="goog_1690910359"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</description><link>https://tweetprogrammer.blogspot.com/2019/02/1-c-program-to-find-sum-of-two-numbers_17.html</link><author>noreply@blogger.com (Mohammad Saquib Khan)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuzwXM9gFmrpHFUsHJ_EaP0meRvTRnb6GCDELgkPTW3dHrNWec08tSPtp4Xly0YBIb14tZD1wxrqm3LKDDje4tLGDrSUxnkZKDU26_QEG_kBeglR1CFGi1Kizmpzii48wKhseCgV2N-WJZ/s72-c/Screenshot_20190218_032845.png" width="72"/><thr:total>0</thr:total><georss:featurename>Prayagraj, Uttar Pradesh 211010, India</georss:featurename><georss:point>25.3488723 81.860682099999963</georss:point><georss:box>-3.0617641999999989 40.552088099999963 53.7595088 123.16927609999996</georss:box></item></channel></rss>