{"id":4196,"date":"2022-08-21T22:28:42","date_gmt":"2022-08-21T16:58:42","guid":{"rendered":"https:\/\/jassweb.com\/solved\/solved-c-goto-statement-not-working-beginner-closed\/"},"modified":"2022-08-21T22:28:42","modified_gmt":"2022-08-21T16:58:42","slug":"solved-c-goto-statement-not-working-beginner-closed","status":"publish","type":"post","link":"https:\/\/jassweb.com\/solved\/solved-c-goto-statement-not-working-beginner-closed\/","title":{"rendered":"[Solved] (C++) Goto statement not working. Beginner [closed]"},"content":{"rendered":"<p> [ad_1]<br \/>\n<\/p>\n<div id=\"answer-24199089\" class=\"answer js-answer accepted-answer js-accepted-answer\" data-answerid=\"24199089\" data-parentid=\"24198585\" data-score=\"7\" data-position-on-page=\"1\" data-highest-scored=\"1\" data-question-has-accepted-highest-score=\"1\" itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n<div class=\"post-layout\">\n<div class=\"votecell post-layout--left\"><\/div>\n<div class=\"answercell post-layout--right\">\n<div class=\"s-prose js-post-body\" itemprop=\"text\">\n<p>One of the most fundamental things we have to do as programmers is to learn to break problems into smaller problems. You are actually running into a whole series of problems.<\/p>\n<p>I&#8217;m going to show you how to solve your problem. You may want to book mark this answer, because I&#8217;m pre-empting some problems you&#8217;re going to run into a few steps down the line and preparing you &#8211; if you pay attention &#8211; to solve them on your own \ud83d\ude09<\/p>\n<p>Let&#8217;s start by stripping down your code.<\/p>\n<p>Live demo here: <a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/ideone.com\/aUCtmM\">http:\/\/ideone.com\/aUCtmM<\/a><\/p>\n<pre><code>#include &lt;iostream&gt;\n\nint main()\n{\n    std::cout &lt;&lt; \"Enter a number: \";\n    int i;\n    std::cin &gt;&gt; i;\n\n    std::cout &lt;&lt; \"Enter a second number: \";\n    int j;\n    std::cin &gt;&gt; j;\n\n    std::cout &lt;&lt; \"i = '\" &lt;&lt; i &lt;&lt; \"', j = '\" &lt;&lt; j &lt;&lt; \"'\\n\";\n}\n<\/code><\/pre>\n<p>What are we checking here? We&#8217;re checking that we can ask the user two questions. That works fine.<\/p>\n<p>Next is your use of goto, which I strongly recommend you do not use. It would be better to use a function. I&#8217;ll demonstrate with your goto case here first:<\/p>\n<pre><code>#include &lt;iostream&gt;\n\nint main()\n{\n    int choice;\n    std::cout &lt;&lt; \"Enter choice 1 or 2: \";\n    std::cin &gt;&gt; choice;\n    if ( choice == 1 )\n        goto CHOSE1;\n    else if ( choice == 2 )\n        goto CHOSE2;\n    else {\n        std::cout &lt;&lt; \"It was a simple enough question!\\n\";\n        goto END;\n    }\n\nCHOSE1:\n    std::cout &lt;&lt; \"Chose 1\\n\";\n    goto END;\n\nCHOSE2:\n    std::cout &lt;&lt; \"Chose 2\\n\";\n    goto END;\n\nEND:\n    std::cout &lt;&lt; \"Here we are at end\\n\";\n}\n<\/code><\/pre>\n<p>live demo: <a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/ideone.com\/1ElcV8\">http:\/\/ideone.com\/1ElcV8<\/a><\/p>\n<p>So goto isn&#8217;t the problem.<\/p>\n<p>That leaves your use of variables. You&#8217;ve really mixed things up nastily by having a second set of variables (mm, uu). Not only do you not need to have these, you&#8217;re doing something very naughty in that these variables only exist inside one scope and not the other. You can &#8220;get away&#8221; with this but it will come back to haunt you later on.<\/p>\n<p>The difference in your two main streams of code is the variable names. The second conversion case looks like this:<\/p>\n<pre><code>    MXNTUS:\nint mm, uu;\ncout &lt;&lt; \"Enter the amount of Pesos to Convert\" &lt;&lt; endl;\ncout &lt;&lt; \"Amount: \";\ncin &gt;&gt; mm;\nuu = mm \/ 12.99;\ncout &lt;&lt; endl;\ncout &lt;&lt; \"US Dollars: \" &lt;&lt; m &lt;&lt; endl;\ngoto END;\n<\/code><\/pre>\n<p>The problem here is that you have &#8211; accidentally &#8211; used the variable &#8220;m&#8221; in your output. It&#8217;s what we call uninitialized.<\/p>\n<pre><code>cout &lt;&lt; \"US Dollars: \" &lt;&lt; m &lt;&lt; endl;\n<\/code><\/pre>\n<p>That <code>m<\/code> in the middle should be <code>mm<\/code>.<\/p>\n<p>Your compiler should actually be warning you about this. If it&#8217;s not, and you&#8217;re just setting out learning, you should figure out how to increase the compiler warning level.<\/p>\n<p>It would be better to make a function to do the conversions; you could make one function for each direction, but I&#8217;ve made a function that handles both cases:<\/p>\n<pre><code>#include &lt;iostream&gt;\n\nstatic const double US_TO_MXN = 12.99;\nstatic const char DATA_DATE[] = \"6\/12\/2014\";\n\nvoid convert(const char* from, const char* to, double exchange)\n{\n    std::cout &lt;&lt; \"Enter the number of \" &lt;&lt; from &lt;&lt; \" to convert to \" &lt;&lt; to &lt;&lt; \".\\n\"\n                 \"Amount: \";\n    int original;\n    std::cin &gt;&gt; original;\n    std::cout &lt;&lt; to &lt;&lt; \": \" &lt;&lt; (original * exchange) &lt;&lt; '\\n';\n}\n\nint main()  \/\/ this is valid since C++2003\n{\n    std::cout &lt;&lt; \"US\/MXN Converter\\n\"\n                 \"1 US = \" &lt;&lt; US_TO_MXN &lt;&lt; \" MXN (\" &lt;&lt; DATA_DATE &lt;&lt; \")\\n\"\n                 \"\\n\";\n\n    int choice = 0;\n    \/\/ Here's a better demonstration of goto\nGET_CHOICE:\n    std::cout &lt;&lt; \"Which conversion do you want to perform?\\n\"\n                \"[1] US to MXN\\n\"\n                \"[2] MXN to US\\n\"\n                \"Selection: \";\n    std::cin &gt;&gt; choice;\n\n    if (choice == 1)\n        convert(\"US Dollars\", \"Pesos\", US_TO_MXN);\n    else if (choice == 2)\n        convert(\"Pesos\", \"US Dollars\", 1 \/ US_TO_MXN);\n    else {\n        std::cerr &lt;&lt; \"Invalid choice. Please try again.\\n\";\n        goto GET_CHOICE;\n    }\n\n    \/\/ this also serves to demonstrate that goto is bad because\n    \/\/ it's not obvious from the above that you have a loop.\n}\n<\/code><\/pre>\n<p>ideone live demo: <a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/ideone.com\/qwpRtQ\">http:\/\/ideone.com\/qwpRtQ<\/a><\/p>\n<p>With this, we could go on to clean things up a whole bunch and extend it:<\/p>\n<pre><code>#include &lt;iostream&gt;\nusing std::cin;\nusing std::cout;\n\nstatic const double USD_TO_MXN = 12.99;\nstatic const double GBP_TO_MXN = 22.03;\nstatic const char DATA_DATE[] = \"6\/12\/2014\";\n\nvoid convert(const char* from, const char* to, double exchange)\n{\n    cout &lt;&lt; \"Enter the number of \" &lt;&lt; from &lt;&lt; \" to convert to \" &lt;&lt; to &lt;&lt; \".\\n\"\n                 \"Amount: \";\n    int original;\n    cin &gt;&gt; original;\n    cout &lt;&lt; '\\n' &lt;&lt; original &lt;&lt; ' ' &lt;&lt; from &lt;&lt; \" gives \" &lt;&lt; int(original * exchange) &lt;&lt; ' ' &lt;&lt; to &lt;&lt; \".\\n\";\n}\n\nint main()  \/\/ this is valid since C++2003\n{\n    cout &lt;&lt; \"Foreign Currency Converter\\n\"\n            \"1 USD = \" &lt;&lt; USD_TO_MXN &lt;&lt; \" MXN (\" &lt;&lt; DATA_DATE &lt;&lt; \")\\n\"\n            \"1 GBP = \" &lt;&lt; GBP_TO_MXN &lt;&lt; \" MXN (\" &lt;&lt; DATA_DATE &lt;&lt; \")\\n\"\n            \"\\n\";\n\n    for ( ; ; ) {   \/\/ continuous loop\n        cout &lt;&lt; \"Which conversion do you want to perform?\\n\"\n                \"[1] USD to MXN\\n\"\n                \"[2] MXN to USD\\n\"\n                \"[3] GBP to MXN\\n\"\n                \"[4] MXN to GBP\\n\"\n                \"[0] Quit\\n\"\n                \"Selection: \";\n        int choice = -1;\n        cin &gt;&gt; choice;\n        cout &lt;&lt; '\\n';\n\n        switch (choice) {\n            case 0:\n                return 0;       \/\/ return from main\n\n            case 1:\n                convert(\"US Dollars\", \"Pesos\", USD_TO_MXN);\n                break;\n\n            case 2:\n                convert(\"Pesos\", \"US Dollars\", 1 \/ USD_TO_MXN);\n                break;\n\n            case 3:\n                convert(\"British Pounds\", \"Pesos\", GBP_TO_MXN);\n                break;\n\n            case 4:\n                convert(\"Pesos\", \"British Pounds\", 1 \/ GBP_TO_MXN);\n                break;\n\n            default:\n                cout &lt;&lt; \"Invalid selection. Try again.\\n\";\n        }\n    }\n}\n<\/code><\/pre>\n<p><a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/ideone.com\/iCXrpU\">http:\/\/ideone.com\/iCXrpU<\/a><\/p>\n<p>There is a lot more room for improvement with this, but I hope it helps you on your way.<\/p>\n<p>&#8212;- EDIT &#8212;-<\/p>\n<p>A late tip: It appears you&#8217;re using visual studio, based on the <code>system(\"PAUSE\")<\/code>. Instead of having to add to your code, just use Debug -&gt; Start Without Debugging or press Ctrl-F5. It&#8217;ll do the pause for you automatically \ud83d\ude42<\/p>\n<p>&#8212;- EDIT 2 &#8212;-<\/p>\n<p>Some &#8220;how did you do that&#8221; points.<\/p>\n<pre><code>    cout &lt;&lt; '\\n' &lt;&lt; original &lt;&lt; ' ' &lt;&lt; from &lt;&lt; \" gives \" &lt;&lt; int(original * exchange) &lt;&lt; ' ' &lt;&lt; to &lt;&lt; \".\\n\";\n<\/code><\/pre>\n<p>I very carefully didn&#8217;t do the <code>using namespace std;<\/code>, when you start using more C++ that directive will become the bane of your existence. It&#8217;s best not to get used to it, and only let yourself start using it later on when you&#8217;re a lot more comfortable with C++ programming and more importantly debugging odd compile errors.<\/p>\n<p>But by adding <code>using std::cout<\/code> and <code>using std::cin<\/code> I saved myself a lot of typing without creating a minefield of function\/variable names that I have to avoid.,<\/p>\n<p>What does the line do then:<\/p>\n<pre><code>    cout &lt;&lt; '\\n' &lt;&lt; original &lt;&lt; ' ' &lt;&lt; from &lt;&lt; \" gives \" &lt;&lt; int(original * exchange) &lt;&lt; ' ' &lt;&lt; to &lt;&lt; \".\\n\";\n<\/code><\/pre>\n<p>The &#8216;\\n&#8217; is a single character, a carriage return. It&#8217;s more efficient to do this than <code>std::endl<\/code> because <code>std::endl<\/code> has to go poke the output system and force a write; it&#8217;s not just the end-of-line character, it actually terminates the line, if you will.<\/p>\n<pre><code>int(original * exchange)\n<\/code><\/pre>\n<p>This is a C++ feature that confuses C programmers. I&#8217;m actually creating a &#8220;temporary&#8221; integer with the result of <code>original * exchange<\/code> as parameters.<\/p>\n<pre><code>int i = 0;\nint i(0);\n<\/code><\/pre>\n<p>both are equivalent, and some programmers suggest it is better to get into the habit of using the second mechanism so that you understand what happens when you later run into something called the &#8220;most vexing parse&#8221; \ud83d\ude42<\/p>\n<pre><code>convert(\"Pesos\", \"British Pounds\", 1 \/ GBP_TO_MXN)\n<\/code><\/pre>\n<p>The 1 \/ x &#8220;invert&#8221;s the value.<\/p>\n<pre><code>    cout &lt;&lt; \"Foreign Currency Converter\\n\"\n            \"1 USD = \" &lt;&lt; USD_TO_MXN &lt;&lt; \" MXN (\" &lt;&lt; DATA_DATE &lt;&lt; \")\\n\"\n            \"1 GBP = \" &lt;&lt; GBP_TO_MXN &lt;&lt; \" MXN (\" &lt;&lt; DATA_DATE &lt;&lt; \")\\n\"\n            \"\\n\";\n<\/code><\/pre>\n<p>This is likely to be confusing. I&#8217;m mixing metaphors with this and I&#8217;m a little ashamed of it, but it reads nicely. Again, employ the concept of breaking problems up into smaller problems.<\/p>\n<pre><code>cout &lt;&lt; \"Hello \" \"world\" &lt;&lt; '\\n';\n<\/code><\/pre>\n<p>(note: &#8220;\\n&#8221; and &#8216;\\n&#8217; are different: &#8220;\\n&#8221; is actually a string whereas &#8216;\\n&#8217; is literally just the carriage return character)<\/p>\n<p>This would print<\/p>\n<pre><code>Hello world\n<\/code><\/pre>\n<p>When C++ sees two string literals separated by whitespace (or comments) like this, it concatenates them, so it actually passes &#8220;Hello world&#8221; to cout.<\/p>\n<p>So you could rewrite this chunk of code as<\/p>\n<pre><code>    cout &lt;&lt; \"Foreign Currency Converter\\n1 USD = \";\n    cout &lt;&lt; USD_TO_MXN;\n    cout &lt;&lt; \" MXN (\";\n    cout &lt;&lt; DATA_DATE;\n    cout &lt;&lt; \")\\n1 GBP = \";\n    cout &lt;&lt; GBP_TO_MXN;\n    cout &lt;&lt; \" MXN (\";\n    cout &lt;&lt; DATA_DATE;\n    cout &lt;&lt; \")\\n\\n\";\n<\/code><\/pre>\n<p>The <code>&lt;&lt;<\/code> is what we call &#8220;semantic sugar&#8221;. When you write<\/p>\n<pre><code>cout &lt;&lt; i;\n<\/code><\/pre>\n<p>the compiler is translating this into<\/p>\n<pre><code>cout.operator&lt;&lt;(i);\n<\/code><\/pre>\n<p>This odd-looking function call returns <code>cout<\/code>. So when you write<\/p>\n<pre><code>cout &lt;&lt; i &lt;&lt; j;\n<\/code><\/pre>\n<p>it&#8217;s actually translating it to<\/p>\n<pre><code>(cout.operator&lt;&lt;(i)).operator&lt;&lt;(j);\n<\/code><\/pre>\n<p>the expression in parenthesis <code>(cout.operator&lt;&lt;(i))<\/code> returns cout, so it becomes<\/p>\n<pre><code>cout.operator&lt;&lt;(i); \/\/ get cout back to use on next line\ncout.operator&lt;&lt;(j);\n<\/code><\/pre>\n<p>Main&#8217;s fingerprint<\/p>\n<pre><code>int main()\nint main(int argc, const char* argv[])\n<\/code><\/pre>\n<p>Both are legal. The first is perfectly acceptable C or C++. The second is only useful when you plan to capture &#8220;command line arguments&#8221;.<\/p>\n<p>Lastly, in main<\/p>\n<pre><code>return 0;\n<\/code><\/pre>\n<p>Remember that <code>main<\/code> is specified as returning <code>int<\/code>. The C and C++ standards make a special case for <code>main<\/code> that say its the only function where it&#8217;s not an error not to return anything, in which case the program&#8217;s &#8220;exit code&#8221; could be anything.<\/p>\n<p>Usually its best to return something. In C and C++ &#8220;0&#8221; is considered &#8220;false&#8221; while anything else (anything that is not-zero) is &#8220;true&#8221;. So C and C++ programs have a convention of returning an error code of 0 (false, no error) to indicate the program was successful or exited without problems, or anything else to indicate (e.g. 1, 2 &#8230; 255) as an error.<\/p>\n<p>Using a &#8220;return&#8221; from main will end the program.<\/p>\n<\/p><\/div>\n<div class=\"mt24\"><\/div>\n<\/div>\n<p>            <span class=\"d-none\" itemprop=\"commentCount\">3<\/span> <\/p><\/div>\n<\/div>\n<p>[ad_2]<\/p>\n<p>solved (C++) Goto statement not working. Beginner [closed] <\/p>\n","protected":false},"excerpt":{"rendered":"<p>[ad_1] One of the most fundamental things we have to do as programmers is to learn to break problems into smaller problems. You are actually running into a whole series of problems. I&#8217;m going to show you how to solve your problem. You may want to book mark this answer, because I&#8217;m pre-empting some problems &#8230; <a title=\"[Solved] (C++) Goto statement not working. Beginner [closed]\" class=\"read-more\" href=\"https:\/\/jassweb.com\/solved\/solved-c-goto-statement-not-working-beginner-closed\/\" aria-label=\"More on [Solved] (C++) Goto statement not working. Beginner [closed]\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[320],"tags":[324,663,664,639],"class_list":["post-4196","post","type-post","status-publish","format-standard","hentry","category-solved","tag-c","tag-converter","tag-goto","tag-if-statement"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>[Solved] (C++) Goto statement not working. Beginner [closed] - JassWeb<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jassweb.com\/solved\/solved-c-goto-statement-not-working-beginner-closed\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[Solved] (C++) Goto statement not working. Beginner [closed] - JassWeb\" \/>\n<meta property=\"og:description\" content=\"[ad_1] One of the most fundamental things we have to do as programmers is to learn to break problems into smaller problems. You are actually running into a whole series of problems. I&#8217;m going to show you how to solve your problem. You may want to book mark this answer, because I&#8217;m pre-empting some problems ... Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jassweb.com\/solved\/solved-c-goto-statement-not-working-beginner-closed\/\" \/>\n<meta property=\"og:site_name\" content=\"JassWeb\" \/>\n<meta property=\"article:published_time\" content=\"2022-08-21T16:58:42+00:00\" \/>\n<meta name=\"author\" content=\"Kirat\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kirat\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-c-goto-statement-not-working-beginner-closed\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-c-goto-statement-not-working-beginner-closed\/\"},\"author\":{\"name\":\"Kirat\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31\"},\"headline\":\"[Solved] (C++) Goto statement not working. Beginner [closed]\",\"datePublished\":\"2022-08-21T16:58:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-c-goto-statement-not-working-beginner-closed\/\"},\"wordCount\":921,\"publisher\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\"},\"keywords\":[\"c++\",\"converter\",\"goto\",\"if-statement\"],\"articleSection\":[\"Solved\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-c-goto-statement-not-working-beginner-closed\/\",\"url\":\"https:\/\/jassweb.com\/solved\/solved-c-goto-statement-not-working-beginner-closed\/\",\"name\":\"[Solved] (C++) Goto statement not working. Beginner [closed] - JassWeb\",\"isPartOf\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#website\"},\"datePublished\":\"2022-08-21T16:58:42+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-c-goto-statement-not-working-beginner-closed\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/jassweb.com\/solved\/solved-c-goto-statement-not-working-beginner-closed\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-c-goto-statement-not-working-beginner-closed\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/jassweb.com\/solved\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[Solved] (C++) Goto statement not working. Beginner [closed]\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/jassweb.com\/solved\/#website\",\"url\":\"https:\/\/jassweb.com\/solved\/\",\"name\":\"JassWeb\",\"description\":\"Build High-quality Websites\",\"publisher\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/jassweb.com\/solved\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\",\"name\":\"Jass Web\",\"url\":\"https:\/\/jassweb.com\/solved\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png\",\"contentUrl\":\"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png\",\"width\":693,\"height\":132,\"caption\":\"Jass Web\"},\"image\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31\",\"name\":\"Kirat\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750\",\"contentUrl\":\"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750\",\"caption\":\"Kirat\"},\"sameAs\":[\"http:\/\/jassweb.com\"],\"url\":\"https:\/\/jassweb.com\/solved\/author\/jaspritsinghghumangmail-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[Solved] (C++) Goto statement not working. Beginner [closed] - JassWeb","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jassweb.com\/solved\/solved-c-goto-statement-not-working-beginner-closed\/","og_locale":"en_US","og_type":"article","og_title":"[Solved] (C++) Goto statement not working. Beginner [closed] - JassWeb","og_description":"[ad_1] One of the most fundamental things we have to do as programmers is to learn to break problems into smaller problems. You are actually running into a whole series of problems. I&#8217;m going to show you how to solve your problem. You may want to book mark this answer, because I&#8217;m pre-empting some problems ... Read more","og_url":"https:\/\/jassweb.com\/solved\/solved-c-goto-statement-not-working-beginner-closed\/","og_site_name":"JassWeb","article_published_time":"2022-08-21T16:58:42+00:00","author":"Kirat","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Kirat","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jassweb.com\/solved\/solved-c-goto-statement-not-working-beginner-closed\/#article","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/solved-c-goto-statement-not-working-beginner-closed\/"},"author":{"name":"Kirat","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31"},"headline":"[Solved] (C++) Goto statement not working. Beginner [closed]","datePublished":"2022-08-21T16:58:42+00:00","mainEntityOfPage":{"@id":"https:\/\/jassweb.com\/solved\/solved-c-goto-statement-not-working-beginner-closed\/"},"wordCount":921,"publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"keywords":["c++","converter","goto","if-statement"],"articleSection":["Solved"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/jassweb.com\/solved\/solved-c-goto-statement-not-working-beginner-closed\/","url":"https:\/\/jassweb.com\/solved\/solved-c-goto-statement-not-working-beginner-closed\/","name":"[Solved] (C++) Goto statement not working. Beginner [closed] - JassWeb","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/#website"},"datePublished":"2022-08-21T16:58:42+00:00","breadcrumb":{"@id":"https:\/\/jassweb.com\/solved\/solved-c-goto-statement-not-working-beginner-closed\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jassweb.com\/solved\/solved-c-goto-statement-not-working-beginner-closed\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jassweb.com\/solved\/solved-c-goto-statement-not-working-beginner-closed\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/jassweb.com\/solved\/"},{"@type":"ListItem","position":2,"name":"[Solved] (C++) Goto statement not working. Beginner [closed]"}]},{"@type":"WebSite","@id":"https:\/\/jassweb.com\/solved\/#website","url":"https:\/\/jassweb.com\/solved\/","name":"JassWeb","description":"Build High-quality Websites","publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jassweb.com\/solved\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/jassweb.com\/solved\/#organization","name":"Jass Web","url":"https:\/\/jassweb.com\/solved\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/","url":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","contentUrl":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","width":693,"height":132,"caption":"Jass Web"},"image":{"@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31","name":"Kirat","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/image\/","url":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750","contentUrl":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750","caption":"Kirat"},"sameAs":["http:\/\/jassweb.com"],"url":"https:\/\/jassweb.com\/solved\/author\/jaspritsinghghumangmail-com\/"}]}},"_links":{"self":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/4196","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/comments?post=4196"}],"version-history":[{"count":0,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/4196\/revisions"}],"wp:attachment":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/media?parent=4196"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/categories?post=4196"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/tags?post=4196"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}