<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[do...while - Schleife]]></title><description><![CDATA[<p>Hi,<br />
ich hab ein Problem mit dem Quelltext:</p>
<pre><code class="language-cpp">/*
 * Das Programm führt eine do-Schleife aus,
 * in der man Zahlen von 1 bis 10 eingeben soll.
 * Die einzige Möglichkeit, sie zu beenden soll
 * die Eingabe von '114' sein.
 */

#include &lt;iostream&gt;
using namespace std;

int main(){
  cout&lt;&lt;&quot;Herzlich Willkommen!&quot;&lt;&lt;endl;
  int zahl;
  do{
    cout&lt;&lt;&quot;==========================&quot;&lt;&lt;endl;
    cout&lt;&lt;&quot;Bitte geben Sie eine Zahl zwischen 1 und 10 ein!&quot;&lt;&lt;endl;
    cin&gt;&gt;zahl;
    cout&lt;&lt;endl;
    if(zahl &lt; 1 || zahl &gt; 10){      //Fehlt noch != 114?
      cerr&lt;&lt;&quot;Fehler bei der Eingabe!&quot;&lt;&lt;endl;
      // Wie komme ich wieder an den Anfang der Schleife?
      // exit (1); beendet die ganze do-Schleife!
    }
    cout&lt;&lt;endl;
    cout&lt;&lt;&quot;Ihre Eingabe war &quot;&lt;&lt;zahl&lt;&lt;endl;
    cout&lt;&lt;&quot;==========================&quot;;
  } while(zahl !! 114); //Wie beende ich die do-Schleife bei Eingabe von '114'?
  return 0;
}
</code></pre>
<p>Sry für die Frage, habe erst angefangen...^^</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/193805/do-while-schleife</link><generator>RSS for Node</generator><lastBuildDate>Mon, 28 Sep 2026 05:14:00 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/193805.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 30 Sep 2007 09:29:26 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to do...while - Schleife on Sun, 30 Sep 2007 09:29:26 GMT]]></title><description><![CDATA[<p>Hi,<br />
ich hab ein Problem mit dem Quelltext:</p>
<pre><code class="language-cpp">/*
 * Das Programm führt eine do-Schleife aus,
 * in der man Zahlen von 1 bis 10 eingeben soll.
 * Die einzige Möglichkeit, sie zu beenden soll
 * die Eingabe von '114' sein.
 */

#include &lt;iostream&gt;
using namespace std;

int main(){
  cout&lt;&lt;&quot;Herzlich Willkommen!&quot;&lt;&lt;endl;
  int zahl;
  do{
    cout&lt;&lt;&quot;==========================&quot;&lt;&lt;endl;
    cout&lt;&lt;&quot;Bitte geben Sie eine Zahl zwischen 1 und 10 ein!&quot;&lt;&lt;endl;
    cin&gt;&gt;zahl;
    cout&lt;&lt;endl;
    if(zahl &lt; 1 || zahl &gt; 10){      //Fehlt noch != 114?
      cerr&lt;&lt;&quot;Fehler bei der Eingabe!&quot;&lt;&lt;endl;
      // Wie komme ich wieder an den Anfang der Schleife?
      // exit (1); beendet die ganze do-Schleife!
    }
    cout&lt;&lt;endl;
    cout&lt;&lt;&quot;Ihre Eingabe war &quot;&lt;&lt;zahl&lt;&lt;endl;
    cout&lt;&lt;&quot;==========================&quot;;
  } while(zahl !! 114); //Wie beende ich die do-Schleife bei Eingabe von '114'?
  return 0;
}
</code></pre>
<p>Sry für die Frage, habe erst angefangen...^^</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1375200</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1375200</guid><dc:creator><![CDATA[Styled]]></dc:creator><pubDate>Sun, 30 Sep 2007 09:29:26 GMT</pubDate></item><item><title><![CDATA[Reply to do...while - Schleife on Sun, 30 Sep 2007 09:36:08 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">while(zahl != 114);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1375206</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1375206</guid><dc:creator><![CDATA[muffmolch]]></dc:creator><pubDate>Sun, 30 Sep 2007 09:36:08 GMT</pubDate></item><item><title><![CDATA[Reply to do...while - Schleife on Sun, 30 Sep 2007 09:37:47 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">* 
 * Das Programm führt eine do-Schleife aus, 
 * in der man Zahlen von 1 bis 10 eingeben soll. 
 * Die einzige Möglichkeit, sie zu beenden soll 
 * die Eingabe von '114' sein. 
 */ 

#include &lt;iostream&gt; 
using namespace std; 

int main(){ 
  cout&lt;&lt;&quot;Herzlich Willkommen!&quot;&lt;&lt;endl; 
  int zahl; 
  do{ 
    cout&lt;&lt;&quot;==========================&quot;&lt;&lt;endl; 
    cout&lt;&lt;&quot;Bitte geben Sie eine Zahl zwischen 1 und 10 ein!&quot;&lt;&lt;endl; 
    cin&gt;&gt;zahl; 
    cout&lt;&lt;endl; 
    if( (zahl &lt; 1 || zahl &gt; 10) &amp;&amp; zahl!=114){      //Fehlt noch != 114? 
      cerr&lt;&lt;&quot;Fehler bei der Eingabe!&quot;&lt;&lt;endl; 
      // Wie komme ich wieder an den Anfang der Schleife? 

      continue;

      // exit (1); beendet die ganze do-Schleife! 
    } 
    cout&lt;&lt;endl; 
    cout&lt;&lt;&quot;Ihre Eingabe war &quot;&lt;&lt;zahl&lt;&lt;endl; 
    cout&lt;&lt;&quot;==========================&quot;; 
  } while(zahl != 114); //Wie beende ich die do-Schleife bei Eingabe von '114'? 
  return 0; 
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1375207</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1375207</guid><dc:creator><![CDATA[muffmolch]]></dc:creator><pubDate>Sun, 30 Sep 2007 09:37:47 GMT</pubDate></item><item><title><![CDATA[Reply to do...while - Schleife on Sun, 30 Sep 2007 09:39:50 GMT]]></title><description><![CDATA[<p>thx, hat geklappt^^</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1375209</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1375209</guid><dc:creator><![CDATA[Styled]]></dc:creator><pubDate>Sun, 30 Sep 2007 09:39:50 GMT</pubDate></item></channel></rss>