<?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[Schleife Frage?]]></title><description><![CDATA[<p>Hallo hab Probleme mit dem folgenden Quelltext. Warum wird die Schleife nur einmal durchlaufen? Nach dem ersten durchlauf hat f doch den Wert 3, warum wird die Schleife dann nicht nochmal durchlaufen?</p>
<p>#include &quot;stdafx.h&quot;<br />
#include &lt;iostream&gt;</p>
<p>using namespace std;</p>
<p>int main(void)<br />
{ double x,min,max,f;<br />
cout&lt;&lt;&quot;Programm zur Annaeherung an eine Nullstelle der Funktion f(x)=x<sup>3+x</sup>2+2x+3\n\n&quot;;<br />
min=-50;<br />
max=50;<br />
do{<br />
x=(min+max)/50;<br />
f=x*x*x+x*x+2*x+3;<br />
cout&lt;&lt;&quot;f(&quot;&lt;&lt;x&lt;&lt;&quot;) = &quot;&lt;&lt;f&lt;&lt;endl;<br />
if (f&gt;=0)<br />
{<br />
max=x;<br />
}<br />
else<br />
{<br />
min=x;<br />
}<br />
cout&lt;&lt;&quot;min = &quot;&lt;&lt;min&lt;&lt;&quot; max = &quot;&lt;&lt;max&lt;&lt;endl;<br />
}<br />
while ((f&lt;0.01) &amp;&amp; (f&gt;=0));</p>
<p>return 0;</p>
<p>}</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/126859/schleife-frage</link><generator>RSS for Node</generator><lastBuildDate>Mon, 24 Aug 2026 22:08:14 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/126859.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 19 Nov 2005 11:48:01 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Schleife Frage? on Sat, 19 Nov 2005 11:48:01 GMT]]></title><description><![CDATA[<p>Hallo hab Probleme mit dem folgenden Quelltext. Warum wird die Schleife nur einmal durchlaufen? Nach dem ersten durchlauf hat f doch den Wert 3, warum wird die Schleife dann nicht nochmal durchlaufen?</p>
<p>#include &quot;stdafx.h&quot;<br />
#include &lt;iostream&gt;</p>
<p>using namespace std;</p>
<p>int main(void)<br />
{ double x,min,max,f;<br />
cout&lt;&lt;&quot;Programm zur Annaeherung an eine Nullstelle der Funktion f(x)=x<sup>3+x</sup>2+2x+3\n\n&quot;;<br />
min=-50;<br />
max=50;<br />
do{<br />
x=(min+max)/50;<br />
f=x*x*x+x*x+2*x+3;<br />
cout&lt;&lt;&quot;f(&quot;&lt;&lt;x&lt;&lt;&quot;) = &quot;&lt;&lt;f&lt;&lt;endl;<br />
if (f&gt;=0)<br />
{<br />
max=x;<br />
}<br />
else<br />
{<br />
min=x;<br />
}<br />
cout&lt;&lt;&quot;min = &quot;&lt;&lt;min&lt;&lt;&quot; max = &quot;&lt;&lt;max&lt;&lt;endl;<br />
}<br />
while ((f&lt;0.01) &amp;&amp; (f&gt;=0));</p>
<p>return 0;</p>
<p>}</p>
]]></description><link>https://www.c-plusplus.net/forum/post/921274</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/921274</guid><dc:creator><![CDATA[bourne]]></dc:creator><pubDate>Sat, 19 Nov 2005 11:48:01 GMT</pubDate></item><item><title><![CDATA[Reply to Schleife Frage? on Sat, 19 Nov 2005 12:14:55 GMT]]></title><description><![CDATA[<p>bourne schrieb:</p>
<blockquote>
<pre><code class="language-cpp">while ((f&lt;0.01) &amp;&amp; (f&gt;=0));
</code></pre>
</blockquote>
<p>Diese Bedingung kann nie true sein. =&gt; Schleife wird nur einmal durchlaufen...</p>
<p>Gruß Caipi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/921311</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/921311</guid><dc:creator><![CDATA[Caipi]]></dc:creator><pubDate>Sat, 19 Nov 2005 12:14:55 GMT</pubDate></item><item><title><![CDATA[Reply to Schleife Frage? on Sat, 19 Nov 2005 12:25:30 GMT]]></title><description><![CDATA[<p>Klar jetzt hab ichs auch verstanden hatte ein denkfehler.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/921324</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/921324</guid><dc:creator><![CDATA[bourne]]></dc:creator><pubDate>Sat, 19 Nov 2005 12:25:30 GMT</pubDate></item><item><title><![CDATA[Reply to Schleife Frage? on Sat, 19 Nov 2005 12:27:10 GMT]]></title><description><![CDATA[<p>Caipi schrieb:</p>
<blockquote>
<p>bourne schrieb:</p>
<blockquote>
<pre><code class="language-cpp">while ((f&lt;0.01) &amp;&amp; (f&gt;=0));
</code></pre>
</blockquote>
<p>Diese Bedingung kann nie true sein. =&gt; Schleife wird nur einmal durchlaufen...</p>
<p>Gruß Caipi</p>
</blockquote>
<p>Klar kann die Bedingung wahr werden, aber nur wenn f im Intervall [0,0,01[ liegt (und 3 ist außerhalb dieses Intervalls).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/921326</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/921326</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Sat, 19 Nov 2005 12:27:10 GMT</pubDate></item><item><title><![CDATA[Reply to Schleife Frage? on Sat, 19 Nov 2005 14:32:39 GMT]]></title><description><![CDATA[<p>CStoll schrieb:</p>
<blockquote>
<p>Caipi schrieb:</p>
<blockquote>
<p>bourne schrieb:</p>
<blockquote>
<pre><code class="language-cpp">while ((f&lt;0.01) &amp;&amp; (f&gt;=0));
</code></pre>
</blockquote>
<p>Diese Bedingung kann nie true sein. =&gt; Schleife wird nur einmal durchlaufen...</p>
<p>Gruß Caipi</p>
</blockquote>
<p>Klar kann die Bedingung wahr werden, aber nur wenn f im Intervall [0,0,01[ liegt (und 3 ist außerhalb dieses Intervalls).</p>
</blockquote>
<p>Jep. Hast recht. Weiß nicht, wo ich mein Hirn beim schreiben gelassen habe... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/921424</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/921424</guid><dc:creator><![CDATA[Caipi]]></dc:creator><pubDate>Sat, 19 Nov 2005 14:32:39 GMT</pubDate></item></channel></rss>