<?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[Einfaches Programm...]]></title><description><![CDATA[<p>Hallo Leute!</p>
<p>Quäle mich grad mal wieder mit programmieren..</p>
<p>Mein Problem... Das Programm gibt zwar korrekte Position und Wert der groessten Zahl ein, aber nicht wieviele Zahlen insgesamt eingegeben wurden....</p>
<p>Was mach ich falsch??</p>
<p>VIelen Dank für Tips und Anregungen im voraus...</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
using namespace std;

int main()
{	

	int groesste_zahl = 0;
	int zaehler = 0;
	int zahl = 0;
	int stelle;

	do
	{

	cout &lt;&lt; &quot;Geben Sie eine Zahl ein: &quot; &lt;&lt; endl;
	cin &gt;&gt; zahl;

	if (zahl &gt;= groesste_zahl)
	{

		groesste_zahl = zahl;
		stelle = zaehler;
                  ++zaehler;

	}
	}
	while (zahl != 0);

	cout &lt;&lt; &quot;Die groesste Zahl ist: &quot; &lt;&lt; groesste_zahl &lt;&lt; &quot;und ist an Position: &quot; &lt;&lt; stelle &lt;&lt; endl;
	cout &lt;&lt; &quot;Insgesamt wurden: &quot; &lt;&lt; zaehler &lt;&lt; &quot; Zahlen eingegeben &quot; &lt;&lt; endl; 

	}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/140577/einfaches-programm</link><generator>RSS for Node</generator><lastBuildDate>Mon, 31 Aug 2026 04:23:07 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/140577.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 15 Mar 2006 19:06:31 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Einfaches Programm... on Wed, 15 Mar 2006 19:24:35 GMT]]></title><description><![CDATA[<p>Hallo Leute!</p>
<p>Quäle mich grad mal wieder mit programmieren..</p>
<p>Mein Problem... Das Programm gibt zwar korrekte Position und Wert der groessten Zahl ein, aber nicht wieviele Zahlen insgesamt eingegeben wurden....</p>
<p>Was mach ich falsch??</p>
<p>VIelen Dank für Tips und Anregungen im voraus...</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
using namespace std;

int main()
{	

	int groesste_zahl = 0;
	int zaehler = 0;
	int zahl = 0;
	int stelle;

	do
	{

	cout &lt;&lt; &quot;Geben Sie eine Zahl ein: &quot; &lt;&lt; endl;
	cin &gt;&gt; zahl;

	if (zahl &gt;= groesste_zahl)
	{

		groesste_zahl = zahl;
		stelle = zaehler;
                  ++zaehler;

	}
	}
	while (zahl != 0);

	cout &lt;&lt; &quot;Die groesste Zahl ist: &quot; &lt;&lt; groesste_zahl &lt;&lt; &quot;und ist an Position: &quot; &lt;&lt; stelle &lt;&lt; endl;
	cout &lt;&lt; &quot;Insgesamt wurden: &quot; &lt;&lt; zaehler &lt;&lt; &quot; Zahlen eingegeben &quot; &lt;&lt; endl; 

	}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1017052</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1017052</guid><dc:creator><![CDATA[Visual Newbie]]></dc:creator><pubDate>Wed, 15 Mar 2006 19:24:35 GMT</pubDate></item><item><title><![CDATA[Reply to Einfaches Programm... on Wed, 15 Mar 2006 19:16:14 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>weil du zaehler zweimal pro Eingabe erhöhst, wenn die Eingabe größer als die bisherigen ist.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1017066</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1017066</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Wed, 15 Mar 2006 19:16:14 GMT</pubDate></item><item><title><![CDATA[Reply to Einfaches Programm... on Wed, 15 Mar 2006 19:23:38 GMT]]></title><description><![CDATA[<p>Der 2. Zähler war Tippfehler...</p>
<p>Trotzdem ist die groesste Zahl an der falschen Position</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1017078</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1017078</guid><dc:creator><![CDATA[Visual Newbie]]></dc:creator><pubDate>Wed, 15 Mar 2006 19:23:38 GMT</pubDate></item><item><title><![CDATA[Reply to Einfaches Programm... on Wed, 15 Mar 2006 19:57:47 GMT]]></title><description><![CDATA[<p>Jetzt inkrementierst du zaehler nur, wenn die eingegebene Zahl größer ist als groesste_zahl. So sollte es funktionieren:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
using namespace std;

int main()
{      
    int groesste_zahl = 0;
    int zaehler = 0;
    int zahl = 0;
    int stelle;

    do
    {   
      cout &lt;&lt; &quot;Geben Sie eine Zahl ein: &quot; &lt;&lt; endl;
      cin &gt;&gt; zahl;
      ++zaehler;
      if (zahl &gt;= groesste_zahl)
      {
        groesste_zahl = zahl;
        stelle = zaehler;
      }
    }
    while (zahl != 0);

    cout &lt;&lt; &quot;Die groesste Zahl ist: &quot; &lt;&lt; groesste_zahl &lt;&lt; &quot;und ist an Position: &quot; &lt;&lt; stelle &lt;&lt; endl;
    cout &lt;&lt; &quot;Insgesamt wurden: &quot; &lt;&lt; zaehler &lt;&lt; &quot; Zahlen eingegeben &quot; &lt;&lt; endl;

}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1017115</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1017115</guid><dc:creator><![CDATA[hallo123456789]]></dc:creator><pubDate>Wed, 15 Mar 2006 19:57:47 GMT</pubDate></item><item><title><![CDATA[Reply to Einfaches Programm... on Wed, 15 Mar 2006 19:59:23 GMT]]></title><description><![CDATA[<p>du musst den zaehler ned innerhalb des if blocks ,sondern ausserhalb erhoehen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1017119</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1017119</guid><dc:creator><![CDATA[-Tdo-]]></dc:creator><pubDate>Wed, 15 Mar 2006 19:59:23 GMT</pubDate></item></channel></rss>