<?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[[GELÖST] for schleife in while schleife und wieder zurück ?!]]></title><description><![CDATA[<p>Hey ihr,</p>
<p>meine aufgabe:<br />
While schleife schreiben und for schleife schreiben...<br />
Meine While Schleife :</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
using namespace std;

int main (){
	     int i = 150;
	     while (i &gt;=0) {
	    	      cout &lt;&lt; i &lt;&lt; endl;
	    	      i -=30;
	     }

}
</code></pre>
<p>Ich glaub die while Schleife ist so eigentlich richtig..<br />
Nun soll ich da eine for- Schleife daraus basteln...<br />
Ich habe absolut keine Ahnung wie das gehen soll.....</p>
<p>Über Hilfe wie immer dankbar...</p>
<p>MFG</p>
<p>faC1al</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/276720/gelöst-for-schleife-in-while-schleife-und-wieder-zurück</link><generator>RSS for Node</generator><lastBuildDate>Wed, 26 Aug 2026 06:50:11 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/276720.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 07 Nov 2010 12:55:26 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [GELÖST] for schleife in while schleife und wieder zurück ?! on Sun, 07 Nov 2010 13:42:49 GMT]]></title><description><![CDATA[<p>Hey ihr,</p>
<p>meine aufgabe:<br />
While schleife schreiben und for schleife schreiben...<br />
Meine While Schleife :</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
using namespace std;

int main (){
	     int i = 150;
	     while (i &gt;=0) {
	    	      cout &lt;&lt; i &lt;&lt; endl;
	    	      i -=30;
	     }

}
</code></pre>
<p>Ich glaub die while Schleife ist so eigentlich richtig..<br />
Nun soll ich da eine for- Schleife daraus basteln...<br />
Ich habe absolut keine Ahnung wie das gehen soll.....</p>
<p>Über Hilfe wie immer dankbar...</p>
<p>MFG</p>
<p>faC1al</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1976638</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1976638</guid><dc:creator><![CDATA[faC1al]]></dc:creator><pubDate>Sun, 07 Nov 2010 13:42:49 GMT</pubDate></item><item><title><![CDATA[Reply to [GELÖST] for schleife in while schleife und wieder zurück ?! on Sun, 07 Nov 2010 12:58:37 GMT]]></title><description><![CDATA[<p>Startwert von i ist gleich was?<br />
Bei jedem Durchgang nimmt i um welchen Betrag ab?<br />
Wie zu welchem Wert von i läuft die while schleife?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1976641</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1976641</guid><dc:creator><![CDATA[kingcool2]]></dc:creator><pubDate>Sun, 07 Nov 2010 12:58:37 GMT</pubDate></item><item><title><![CDATA[Reply to [GELÖST] for schleife in while schleife und wieder zurück ?! on Sun, 07 Nov 2010 13:05:00 GMT]]></title><description><![CDATA[<p>Naja, der startwert von i ist hier 150 und soll dann denk ich mal auch so bleiben...<br />
Solange i &gt; 0 ist wird die Schleife ausgeführt...<br />
i wird jedes mal dabei um 30 kleiner...<br />
Bis die Bedingung nichtmehr erfüllt wird...<br />
Aber wie soll das mit einer for -Schleife gehen ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1976644</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1976644</guid><dc:creator><![CDATA[faC1al]]></dc:creator><pubDate>Sun, 07 Nov 2010 13:05:00 GMT</pubDate></item><item><title><![CDATA[Reply to [GELÖST] for schleife in while schleife und wieder zurück ?! on Sun, 07 Nov 2010 13:07:19 GMT]]></title><description><![CDATA[<p>Was sind denn die 3 Angaben, die im Kopf einer for-Schleife stehen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1976647</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1976647</guid><dc:creator><![CDATA[SG1]]></dc:creator><pubDate>Sun, 07 Nov 2010 13:07:19 GMT</pubDate></item><item><title><![CDATA[Reply to [GELÖST] for schleife in while schleife und wieder zurück ?! on Sun, 07 Nov 2010 13:07:50 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">for (&lt;startwert&gt;; &lt;bedingung&gt;; &lt;befehl nach ausführung&gt;)
{
    // ...
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1976648</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1976648</guid><dc:creator><![CDATA[theliquidwave]]></dc:creator><pubDate>Sun, 07 Nov 2010 13:07:50 GMT</pubDate></item><item><title><![CDATA[Reply to [GELÖST] for schleife in while schleife und wieder zurück ?! on Sun, 07 Nov 2010 13:10:15 GMT]]></title><description><![CDATA[<p>for( initialisierung; bedingung; inkrement)</p>
<p>also z.b for (i=0; i&lt;5 ; i++)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1976651</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1976651</guid><dc:creator><![CDATA[faC1al]]></dc:creator><pubDate>Sun, 07 Nov 2010 13:10:15 GMT</pubDate></item><item><title><![CDATA[Reply to [GELÖST] for schleife in while schleife und wieder zurück ?! on Sun, 07 Nov 2010 13:13:49 GMT]]></title><description><![CDATA[<p>faC1al schrieb:</p>
<blockquote>
<p>for( initialisierung; bedingung; inkrement)</p>
</blockquote>
<p>Nicht inkrement, sondern ein beliebiger Ausdruck. Also z. B. auch</p>
<pre><code class="language-cpp">for(int i = 0; i &lt; 100; i += 10)
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1976659</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1976659</guid><dc:creator><![CDATA[Michael E.]]></dc:creator><pubDate>Sun, 07 Nov 2010 13:13:49 GMT</pubDate></item><item><title><![CDATA[Reply to [GELÖST] for schleife in while schleife und wieder zurück ?! on Sun, 07 Nov 2010 13:14:39 GMT]]></title><description><![CDATA[<p>mhh also vllt in meinem fall so:</p>
<pre><code class="language-cpp">int i = 150;

for (i = 150; i &gt;0 ; i-=30) cout &lt;&lt;i &lt;&lt; endl;
</code></pre>
<p>Kommt mir aber recht spanisch vor <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1976661</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1976661</guid><dc:creator><![CDATA[faC1al]]></dc:creator><pubDate>Sun, 07 Nov 2010 13:14:39 GMT</pubDate></item><item><title><![CDATA[Reply to [GELÖST] for schleife in while schleife und wieder zurück ?! on Sun, 07 Nov 2010 13:15:32 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">for (int i = 150; i &gt;0 ; i-=30)
</code></pre>
<p>So wäre es wohl üblicher. Aber so ist es richtig. Warum testet du es nicht einfach? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>Gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1976662</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1976662</guid><dc:creator><![CDATA[theliquidwave]]></dc:creator><pubDate>Sun, 07 Nov 2010 13:15:32 GMT</pubDate></item><item><title><![CDATA[Reply to [GELÖST] for schleife in while schleife und wieder zurück ?! on Sun, 07 Nov 2010 13:20:05 GMT]]></title><description><![CDATA[<p>faC1al schrieb:</p>
<blockquote>
<p>for( initialisierung; bedingung; inkrement)</p>
</blockquote>
<pre><code class="language-cpp">initialisierung;
while (bedingung)
{
  // ...

  inkrement;
}
</code></pre>
<p>edit: Oh, es war genau das umgekehrt gefragt <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> . Ich sollte die ersten Beiträge aufmerksamer lesen anstatt bloß die Überschrift und den letzten Beitrag</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1976666</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1976666</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Sun, 07 Nov 2010 13:20:05 GMT</pubDate></item><item><title><![CDATA[Reply to [GELÖST] for schleife in while schleife und wieder zurück ?! on Sun, 07 Nov 2010 13:19:50 GMT]]></title><description><![CDATA[<p>Wollte es testen und habe mal den rest hinzugeschrieben:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
using namespace std;

int main (){
	     int i = 150;
	     for (i = 150 ; i &gt; 0 ; i -=30)
	    	      cout &lt;&lt; i &lt;&lt; endl;

	     }

return 0;
}
</code></pre>
<p>Nun bekomm ich einen synthax Fehler bei &quot;return 0;&quot;..<br />
P.S ich initialisiere immer alles vorher, weil es so immer in meinem c++ Buch steht <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1976670</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1976670</guid><dc:creator><![CDATA[faC1al]]></dc:creator><pubDate>Sun, 07 Nov 2010 13:19:50 GMT</pubDate></item><item><title><![CDATA[Reply to [GELÖST] for schleife in while schleife und wieder zurück ?! on Sun, 07 Nov 2010 13:21:59 GMT]]></title><description><![CDATA[<p>Deine Klammern passen nicht. Von deiner Einrückung her zu urteilen willst du nach for eine Klammer öffnen, tust du aber nicht.</p>
<p>edit: Ein Editor mit automatischer Einrückung und Klammerhervorhebung würde da gute Dienste leisten.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1976672</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1976672</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Sun, 07 Nov 2010 13:21:59 GMT</pubDate></item><item><title><![CDATA[Reply to [GELÖST] for schleife in while schleife und wieder zurück ?! on Sun, 07 Nov 2010 13:26:57 GMT]]></title><description><![CDATA[<p>Oha, stimmt....<br />
Super mal wieder vielen Dank an allen beteiligten... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>Ich fasse nochmal zusammen wie man das Problem am besten löst:</p>
<p>Erst anschauen wie die Schleife funktioniert, die man gerade vor sich hat( Was passiert mit dem Startwert, wann terminiert die Schleife etc..).<br />
Danach vergleichen mit den Eigenschaften in die man sie umwandeln will und einfach einsetzten <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1976679</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1976679</guid><dc:creator><![CDATA[faC1al]]></dc:creator><pubDate>Sun, 07 Nov 2010 13:26:57 GMT</pubDate></item><item><title><![CDATA[Reply to [GELÖST] for schleife in while schleife und wieder zurück ?! on Sun, 07 Nov 2010 14:13:28 GMT]]></title><description><![CDATA[<p>Wobei...</p>
<pre><code class="language-cpp">int i = 150;
while (i &gt;=0)
{
	cout &lt;&lt; i &lt;&lt; endl;
	i -=30;
}
</code></pre>
<p>und</p>
<pre><code class="language-cpp">for (int i = 150 ; i &gt; 0 ; i -=30)
{
	cout &lt;&lt; i &lt;&lt; endl;
}
</code></pre>
<p>...nicht zur gleichen Ausgabe führen wird (&gt;= 0). Im Grunde genommen muss es als falsch angesehen werden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1976720</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1976720</guid><dc:creator><![CDATA[Vicious Falcon]]></dc:creator><pubDate>Sun, 07 Nov 2010 14:13:28 GMT</pubDate></item></channel></rss>