<?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[Primzahl]]></title><description><![CDATA[<p>Hallo zusammen , ich brauch mal wieder eure Hilfe.<br />
Ich bekomme kein Ergebnis angezeigt, was habe ich verkehrt gemacht?<br />
Schleife oder bool? und schon mal Danke</p>
<pre><code>#include &lt;iostream&gt;

using namespace std;

int main()
{

    int i;
    i=2;
    int testZahl;

    cout &lt;&lt; &quot;Bitte gib die Prime test Zahl ein!&quot; &lt;&lt; endl;
    cin  &gt;&gt; testZahl;

    bool ist_eine_Primzahl = true;

    while(1 &lt; testZahl)
    {
        if (testZahl % i== 0)
        {
            ist_eine_Primzahl = false;
        }
        i++;
    }

    if (testZahl)
    {
        cout&lt;&lt; endl;
        cout&lt;&lt; &quot;Es ist eine Prim Zahl&quot;&lt;&lt; endl;
    }
    else
        {
        cout&lt;&lt; endl;
        cout&lt;&lt; &quot;Es ist keine Prim Zahl&quot;&lt;&lt; endl;
        }

return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/326441/primzahl</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Jul 2026 23:47:45 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/326441.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 18 Jun 2014 12:18:31 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Primzahl on Wed, 18 Jun 2014 12:18:31 GMT]]></title><description><![CDATA[<p>Hallo zusammen , ich brauch mal wieder eure Hilfe.<br />
Ich bekomme kein Ergebnis angezeigt, was habe ich verkehrt gemacht?<br />
Schleife oder bool? und schon mal Danke</p>
<pre><code>#include &lt;iostream&gt;

using namespace std;

int main()
{

    int i;
    i=2;
    int testZahl;

    cout &lt;&lt; &quot;Bitte gib die Prime test Zahl ein!&quot; &lt;&lt; endl;
    cin  &gt;&gt; testZahl;

    bool ist_eine_Primzahl = true;

    while(1 &lt; testZahl)
    {
        if (testZahl % i== 0)
        {
            ist_eine_Primzahl = false;
        }
        i++;
    }

    if (testZahl)
    {
        cout&lt;&lt; endl;
        cout&lt;&lt; &quot;Es ist eine Prim Zahl&quot;&lt;&lt; endl;
    }
    else
        {
        cout&lt;&lt; endl;
        cout&lt;&lt; &quot;Es ist keine Prim Zahl&quot;&lt;&lt; endl;
        }

return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2404412</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2404412</guid><dc:creator><![CDATA[juhu123]]></dc:creator><pubDate>Wed, 18 Jun 2014 12:18:31 GMT</pubDate></item><item><title><![CDATA[Reply to Primzahl on Wed, 18 Jun 2014 12:25:03 GMT]]></title><description><![CDATA[<p>die while-Schleife ist eine Endlosschleife für testZahl &gt; 1</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2404415</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2404415</guid><dc:creator><![CDATA[großbuchstaben]]></dc:creator><pubDate>Wed, 18 Jun 2014 12:25:03 GMT</pubDate></item><item><title><![CDATA[Reply to Primzahl on Wed, 18 Jun 2014 12:25:08 GMT]]></title><description><![CDATA[<p>juhu123 schrieb:</p>
<blockquote>
<pre><code>while(1 &lt; testZahl) // Eins ist vermutlich immer kleiner als deine Testzahl -&gt; Endlosschleife
    {
        if (testZahl % i== 0)
        {
            ist_eine_Primzahl = false;
        }
        i++;
    }
</code></pre>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/2404416</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2404416</guid><dc:creator><![CDATA[happystudent]]></dc:creator><pubDate>Wed, 18 Jun 2014 12:25:08 GMT</pubDate></item><item><title><![CDATA[Reply to Primzahl on Wed, 18 Jun 2014 12:25:41 GMT]]></title><description><![CDATA[<p>Zeile 19 und Zeile 28, jeweils die Bedingungen sind etwas, naja, ungenau...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2404417</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2404417</guid><dc:creator><![CDATA[Skym0sh0]]></dc:creator><pubDate>Wed, 18 Jun 2014 12:25:41 GMT</pubDate></item><item><title><![CDATA[Reply to Primzahl on Wed, 18 Jun 2014 12:27:28 GMT]]></title><description><![CDATA[<p>5 Sek schneller <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="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2404418</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2404418</guid><dc:creator><![CDATA[großbuchstaben]]></dc:creator><pubDate>Wed, 18 Jun 2014 12:27:28 GMT</pubDate></item><item><title><![CDATA[Reply to Primzahl on Wed, 18 Jun 2014 13:19:53 GMT]]></title><description><![CDATA[<p>Dein Lörres is bestimmt en Meter lang^^</p>
<p>Immer dran denken, im Internet diskutieren und bei den Paralympics teilnehmen ist dasselbe. Selbst wennde gewinnst, biste immer noch behindert...</p>
<p>[/Sarcasm]</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2404432</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2404432</guid><dc:creator><![CDATA[Skym0sh0]]></dc:creator><pubDate>Wed, 18 Jun 2014 13:19:53 GMT</pubDate></item><item><title><![CDATA[Reply to Primzahl on Wed, 18 Jun 2014 13:25:18 GMT]]></title><description><![CDATA[<pre><code>int p = 13 ;
for ( int i = 2 ;  i &lt;= p/2 ;  ++i )
    if ( p % i == 0 )
    {
       // p nicht prim
       break ;
    }

// p prim
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2404436</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2404436</guid><dc:creator><![CDATA[Thilo87]]></dc:creator><pubDate>Wed, 18 Jun 2014 13:25:18 GMT</pubDate></item><item><title><![CDATA[Reply to Primzahl on Wed, 18 Jun 2014 13:36:12 GMT]]></title><description><![CDATA[<p>Erklär mal warum, du bist p/2 gehst und nicht bis p oder p/3 oder p/4 oder p/n</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2404438</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2404438</guid><dc:creator><![CDATA[Skym0sh0]]></dc:creator><pubDate>Wed, 18 Jun 2014 13:36:12 GMT</pubDate></item><item><title><![CDATA[Reply to Primzahl on Wed, 18 Jun 2014 14:00:38 GMT]]></title><description><![CDATA[<p>Skym0sh0 schrieb:</p>
<blockquote>
<p>Erklär mal warum, du bist p/2 gehst und nicht bis p oder p/3 oder p/4 oder p/n</p>
</blockquote>
<p>Joa, die Standardmethode ist bis zur Wurzel gehen. Und dann nicht Quadratzahlen vergessen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2404441</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2404441</guid><dc:creator><![CDATA[Columbo]]></dc:creator><pubDate>Wed, 18 Jun 2014 14:00:38 GMT</pubDate></item><item><title><![CDATA[Reply to Primzahl on Wed, 18 Jun 2014 14:10:02 GMT]]></title><description><![CDATA[<p>Vielleicht weil zwischen p/3 und p/2 noch ein Teiler von p liegen kann (bin ich mir nicht sicher), zwischen p/2 und p aber nicht. Ist ja auch wurscht, das ist so oder so keine effektive Methode, um eine Zahl auf Primeigenschaft zu testen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2404442</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2404442</guid><dc:creator><![CDATA[Thilo87]]></dc:creator><pubDate>Wed, 18 Jun 2014 14:10:02 GMT</pubDate></item></channel></rss>