<?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[While Hilfe]]></title><description><![CDATA[<p>Ich lerne grad vom Buch C++. Habe ein Whilebeispielprogramm abgeschrieben.<br />
So sieht der Code hier aus.</p>
<pre><code class="language-cpp">#include &lt;iostream.h&gt;
int main(){
unsigned short small;
unsigned long large;
unsigned short max=65535;

cout &lt;&lt; &quot;Bitte eine kleine Zahl eingeben: &quot;;
cin &gt;&gt; small;
cout &lt;&lt; &quot;Bitte eine grosse Zahl eingeben: &quot;;
cin &gt;&gt; large;

cout &lt;&lt; &quot;Klein: &quot;&lt;&lt; small &lt;&lt; &quot;...&quot;;
cin.get();

while (small &lt; large &amp;&amp; large &gt; 0 &amp;&amp; small &lt; max)
{
        if(small % 5000 == 0){
        cout &lt;&lt; &quot;.&quot;;
        }
small++;
large-=2;
}

cout &lt;&lt; &quot;\nKlein: &quot;&lt;&lt; small &lt;&lt;&quot; - Gross: &quot;&lt;&lt; large &lt;&lt; endl;
cin.get();

return 0;
}
</code></pre>
<p>Also, ein paar fragen hätte ich :)**<br />
- Wieso wird hier unsigned verwendet?<br />
- Wieso am Ende return 0? Wenn ich return 3 schreibe ändert sich auch nichts.<br />
- Und wieso small % 5000?**</p>
<p>MfG<br />
<strong>T</strong>echnology</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/137595/while-hilfe</link><generator>RSS for Node</generator><lastBuildDate>Sat, 29 Aug 2026 19:40:27 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/137595.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 18 Feb 2006 20:31:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to While Hilfe on Sat, 18 Feb 2006 20:31:00 GMT]]></title><description><![CDATA[<p>Ich lerne grad vom Buch C++. Habe ein Whilebeispielprogramm abgeschrieben.<br />
So sieht der Code hier aus.</p>
<pre><code class="language-cpp">#include &lt;iostream.h&gt;
int main(){
unsigned short small;
unsigned long large;
unsigned short max=65535;

cout &lt;&lt; &quot;Bitte eine kleine Zahl eingeben: &quot;;
cin &gt;&gt; small;
cout &lt;&lt; &quot;Bitte eine grosse Zahl eingeben: &quot;;
cin &gt;&gt; large;

cout &lt;&lt; &quot;Klein: &quot;&lt;&lt; small &lt;&lt; &quot;...&quot;;
cin.get();

while (small &lt; large &amp;&amp; large &gt; 0 &amp;&amp; small &lt; max)
{
        if(small % 5000 == 0){
        cout &lt;&lt; &quot;.&quot;;
        }
small++;
large-=2;
}

cout &lt;&lt; &quot;\nKlein: &quot;&lt;&lt; small &lt;&lt;&quot; - Gross: &quot;&lt;&lt; large &lt;&lt; endl;
cin.get();

return 0;
}
</code></pre>
<p>Also, ein paar fragen hätte ich :)**<br />
- Wieso wird hier unsigned verwendet?<br />
- Wieso am Ende return 0? Wenn ich return 3 schreibe ändert sich auch nichts.<br />
- Und wieso small % 5000?**</p>
<p>MfG<br />
<strong>T</strong>echnology</p>
]]></description><link>https://www.c-plusplus.net/forum/post/997531</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/997531</guid><dc:creator><![CDATA[technology]]></dc:creator><pubDate>Sat, 18 Feb 2006 20:31:00 GMT</pubDate></item><item><title><![CDATA[Reply to While Hilfe on Sat, 18 Feb 2006 22:31:02 GMT]]></title><description><![CDATA[<p>hallo</p>
<p>such dir mal ein gutest c+ tutorial und arbeite es durch <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>% heißt modulo<br />
return 0 heißt alles ok<br />
unsigned heißt nur der 'postive' wertebereich</p>
]]></description><link>https://www.c-plusplus.net/forum/post/997578</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/997578</guid><dc:creator><![CDATA[elise]]></dc:creator><pubDate>Sat, 18 Feb 2006 22:31:02 GMT</pubDate></item><item><title><![CDATA[Reply to While Hilfe on Mon, 20 Feb 2006 07:38:39 GMT]]></title><description><![CDATA[<p>technology schrieb:</p>
<blockquote>
<p>- Wieso am Ende return 0? Wenn ich return 3 schreibe ändert sich auch nichts.</p>
</blockquote>
<p>Der Rückgabewert der main() geht ans Betriebssystem - und dort könntest du noch eine Fehlerauswertung dahinterschalten (if errorlevel xxx).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/998254</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/998254</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Mon, 20 Feb 2006 07:38:39 GMT</pubDate></item></channel></rss>