{"id":4638,"date":"2017-10-07T07:18:23","date_gmt":"2017-10-07T07:18:23","guid":{"rendered":"https:\/\/www.testingdocs.com\/questions\/?p=4638"},"modified":"2021-03-17T08:52:50","modified_gmt":"2021-03-17T08:52:50","slug":"flowchart-to-swap-two-numbers-without-using-any-other-variables","status":"publish","type":"post","link":"https:\/\/www.testingdocs.com\/questions\/flowchart-to-swap-two-numbers-without-using-any-other-variables\/","title":{"rendered":"Flowchart to swap two numbers without using any other variables"},"content":{"rendered":"<h3>Introduction<\/h3>\n<p>Flowchart to swap two numbers without using any other variables. Normally, during a swap operation, we tend to use a temp variable to hold one value. In this tutorial, we will design a flowchart to swap numbers without using a temporary variable.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4640\" src=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/swap-flowchart.png\" alt=\"swap flowchart\" width=\"1920\" height=\"1012\" title=\"\" srcset=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/swap-flowchart.png 1920w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/swap-flowchart-300x158.png 300w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/swap-flowchart-1024x540.png 1024w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/swap-flowchart-768x405.png 768w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/swap-flowchart-1536x810.png 1536w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/p>\n<h3>Sample output<\/h3>\n<p>x=32<br \/>\ny=85<br \/>\nAfter swap<br \/>\nx=85<br \/>\ny=32<br \/>\n&#8212;-Run complete. 12 symbols evaluated.&#8212;-<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6432\" src=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/swap-two-numbers-flowchart.png\" alt=\"swap two numbers flowchart\" width=\"1210\" height=\"606\" title=\"\" srcset=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/swap-two-numbers-flowchart.png 1210w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/swap-two-numbers-flowchart-300x150.png 300w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/swap-two-numbers-flowchart-1024x513.png 1024w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/swap-two-numbers-flowchart-768x385.png 768w\" sizes=\"auto, (max-width: 1210px) 100vw, 1210px\" \/><\/h3>\n<h3><\/h3>\n<h3>Pseudocode<\/h3>\n<p>\/**<br \/>\n* NAME:www.TestingDocs.com<br \/>\n* DATE:<br \/>\n* FILE:<br \/>\n* COMMENTS:<br \/>\n*\/<\/p>\n<p>START<br \/>\n\/\/ declare variables<br \/>\nx = 0;<br \/>\ny = 0;<\/p>\n<p>Prompt &#8220;Enter x&#8221;;<br \/>\nInput x<br \/>\nPrompt &#8220;Enter y&#8221;;<br \/>\nInput y<br \/>\nPrint(&#8220;x=&#8221; + x);<br \/>\nPrint(&#8220;y=&#8221; + y);<br \/>\nx = (x + y);<br \/>\ny = x &#8211; y;<br \/>\nx = x &#8211; y;<br \/>\nPrint(&#8220;After swap&#8221;);<br \/>\nPrint(&#8220;x=&#8221; + x);<br \/>\nPrint(&#8220;y=&#8221; + y);<br \/>\nSTOP<\/p>\n<h3><\/h3>\n<h3>More Flowchart Examples<\/h3>\n<p><strong><a href=\"https:\/\/www.testingdocs.com\/raptor-flowchart-examples\/\">https:\/\/www.testingdocs.com\/raptor-flowchart-examples\/<\/a><\/strong><\/p>\n<h3>Raptor Tutorial<\/h3>\n<p>Raptor Tutorials on this website can be found at:<\/p>\n<p><a href=\"https:\/\/www.testingdocs.com\/raptor-a-flowchart-tool\/\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>https:\/\/www.testingdocs.com\/raptor-a-flowchart-tool\/<\/strong><\/a><\/p>\n<p>RAPTOR official website: <a href=\"https:\/\/raptor.martincarlisle.com\/\" rel=\"noopener\">https:\/\/raptor.martincarlisle.com\/<\/a><\/p>\n<!--themify_builder_content-->\n<div id=\"themify_builder_content-4638\" data-postid=\"4638\" class=\"themify_builder_content themify_builder_content-4638 themify_builder tf_clear\">\n    <\/div>\n<!--\/themify_builder_content-->\n","protected":false},"excerpt":{"rendered":"<p>Introduction Flowchart to swap two numbers without using any other variables. Normally, during a swap operation, we tend to use a temp variable to hold one value. In this tutorial, we will design a flowchart to swap numbers without using a temporary variable. &nbsp; Sample output x=32 y=85 After swap x=85 y=32 &#8212;-Run complete. 12 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[187],"tags":[19],"class_list":["post-4638","post","type-post","status-publish","format-standard","hentry","category-flowchart","tag-raptor","has-post-title","has-post-date","has-post-category","has-post-tag","has-post-comment","has-post-author",""],"_links":{"self":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/4638","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/comments?post=4638"}],"version-history":[{"count":7,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/4638\/revisions"}],"predecessor-version":[{"id":19335,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/4638\/revisions\/19335"}],"wp:attachment":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/media?parent=4638"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/categories?post=4638"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/tags?post=4638"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}