{"id":162,"date":"2020-07-02T03:18:11","date_gmt":"2020-07-02T03:18:11","guid":{"rendered":"\/?p=162"},"modified":"2020-07-02T03:19:51","modified_gmt":"2020-07-02T03:19:51","slug":"swap-two-numbers","status":"publish","type":"post","link":"http:\/\/suryaprakash.com.np\/?p=162","title":{"rendered":"Swap Two Numbers"},"content":{"rendered":"<p>\/<span style=\"color: #000080;\">\/interchanging the value of two variable<\/span><br \/>\n<span style=\"color: #000080;\">#include&lt;stdio.h&gt;<\/span><br \/>\n<span style=\"color: #000080;\">void main()<\/span><br \/>\n<span style=\"color: #000080;\">{<\/span><br \/>\n<span style=\"color: #000080;\">int a,b,t;<\/span><br \/>\n<span style=\"color: #000080;\">printf(&#8220;enter the value of a and b\\n&#8221;);<\/span><br \/>\n<span style=\"color: #000080;\">scanf(&#8220;%d%d&#8221;,&amp;a,&amp;b);<\/span><br \/>\n<span style=\"color: #000080;\">printf(&#8220;Before Swap:\\n a=%d,\\tb=%d&#8221;,a,b);<\/span><br \/>\n<span style=\"color: #000080;\">t=a;<\/span><br \/>\n<span style=\"color: #000080;\">a=b;<\/span><br \/>\n<span style=\"color: #000080;\">b=t;<\/span><br \/>\n<span style=\"color: #000080;\">printf(&#8220;\\nAfter Swap:\\n a=%d,\\tb=%d&#8221;,a,b);<\/span><br \/>\n<span style=\"color: #000080;\">}<\/span><\/p>\n<p><strong>OUTPUT<\/strong><\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-medium wp-image-163\" src=\"\/wp-content\/uploads\/2020\/07\/Swap-300x147.png\" alt=\"\" width=\"300\" height=\"147\" srcset=\"\/wp-content\/uploads\/2020\/07\/Swap-300x147.png 300w, \/wp-content\/uploads\/2020\/07\/Swap.png 452w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>Here a Temporary variable is used to interchange the value of variables. Initially the value of a is stored in temporary variable t. Then, the value of b is override the value of a and then finally the value of b is overridden by temporary variable value. Hence, the value is Swapped.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\/\/interchanging the value of two variable #include&lt;stdio.h&gt; void main() { int a,b,t; printf(&#8220;enter the value of a and b\\n&#8221;); scanf(&#8220;%d%d&#8221;,&amp;a,&amp;b); &hellip; <\/p>\n","protected":false},"author":1,"featured_media":164,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[],"_links":{"self":[{"href":"http:\/\/suryaprakash.com.np\/index.php?rest_route=\/wp\/v2\/posts\/162"}],"collection":[{"href":"http:\/\/suryaprakash.com.np\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/suryaprakash.com.np\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/suryaprakash.com.np\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/suryaprakash.com.np\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=162"}],"version-history":[{"count":3,"href":"http:\/\/suryaprakash.com.np\/index.php?rest_route=\/wp\/v2\/posts\/162\/revisions"}],"predecessor-version":[{"id":167,"href":"http:\/\/suryaprakash.com.np\/index.php?rest_route=\/wp\/v2\/posts\/162\/revisions\/167"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/suryaprakash.com.np\/index.php?rest_route=\/wp\/v2\/media\/164"}],"wp:attachment":[{"href":"http:\/\/suryaprakash.com.np\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=162"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/suryaprakash.com.np\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=162"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/suryaprakash.com.np\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=162"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}