<?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[Wieder mal IF und Else]]></title><description><![CDATA[<p>Hi</p>
<p>Ich weiss ich weiss immer wieder diese IF und Else Fragen <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>
<p>Eigentlich kann ich If/ -Elseverzweigungen schreiben, da ich aber ein Anfänger bin und noch wenig Erfahrung hab... find ich den Fehler im Code nicht.</p>
<p>Würde mir einer helfen?</p>
<pre><code class="language-cpp">#include &lt;cstdlib&gt;
#include &lt;iostream&gt;

using namespace std;

int main(int argc, char *argv[])
{

    cout&lt;&lt;&quot;\t\t\t\t 7.Teil\n\n&quot;;

    int wieOft;
    int ZahlOderWort;

    ProgrammStart:
    cout&lt;&lt;&quot; Was moechten Sie wie oft ausgeben lassen?\n\n&quot;;
    cout&lt;&lt;&quot; Eine Zahl(1) oder ein Wort(2) ? &quot;;
    cin&gt;&gt;ZahlOderWort;
    cout&lt;&lt;&quot;\n&quot;;

    if(ZahlOderWort == 1)
       { // A
        int welcheZahl;
        cout&lt;&lt;&quot; Welche Zahl? &quot;;
        cin&gt;&gt; welcheZahl;
        cout&lt;&lt;&quot; Wie oft? &quot;;
        cin&gt;&gt;wieOft;
        cout&lt;&lt;&quot;\n&quot;;

            while(wieOft &gt; 0)
             { // B
              cout&lt;&lt;&quot; &quot; &lt;&lt;welcheZahl &lt;&lt;&quot;\n&quot;;
              wieOft--;
             } // B

         cout&lt;&lt;&quot;\n Ende \n\n&quot;;

         } // A
    else
        { // A
         if(ZahlOderWort == 2);
           { // B
            string welchesWort; // string-Variable

            cout&lt;&lt;&quot; Welches Wort? &quot;;
            cin&gt;&gt;welchesWort;
            cout&lt;&lt;&quot; Wie oft? &quot;;
            cin&gt;&gt;wieOft;
            cout&lt;&lt;&quot;\n&quot;;

            int tmp = 0;

                while(wieOft &gt; 0)
                { // C
                  cout&lt;&lt;&quot; &quot; &lt;&lt;++tmp &lt;&lt;&quot;. &quot; &lt;&lt;welchesWort &lt;&lt;&quot;\n&quot;;
                  wieOft--;
                } // C
            cout&lt;&lt;&quot;\n Ende\n\n&quot;;
            } // B
            else // &lt;&lt;&lt;--- GENAU HIER SPUCKT DEV-CPP EINEN FEHLER AUS
               { // D
                cout&lt;&lt;&quot; Test&quot;; // Test-Ausdruck
               } // D
         } // A

    system(&quot;PAUSE&quot;);
    return EXIT_SUCCESS;
}
</code></pre>
<p>Danke <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/177577/wieder-mal-if-und-else</link><generator>RSS for Node</generator><lastBuildDate>Sun, 20 Sep 2026 01:53:59 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/177577.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 01 Apr 2007 19:51:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Wieder mal IF und Else on Sun, 01 Apr 2007 19:51:44 GMT]]></title><description><![CDATA[<p>Hi</p>
<p>Ich weiss ich weiss immer wieder diese IF und Else Fragen <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>
<p>Eigentlich kann ich If/ -Elseverzweigungen schreiben, da ich aber ein Anfänger bin und noch wenig Erfahrung hab... find ich den Fehler im Code nicht.</p>
<p>Würde mir einer helfen?</p>
<pre><code class="language-cpp">#include &lt;cstdlib&gt;
#include &lt;iostream&gt;

using namespace std;

int main(int argc, char *argv[])
{

    cout&lt;&lt;&quot;\t\t\t\t 7.Teil\n\n&quot;;

    int wieOft;
    int ZahlOderWort;

    ProgrammStart:
    cout&lt;&lt;&quot; Was moechten Sie wie oft ausgeben lassen?\n\n&quot;;
    cout&lt;&lt;&quot; Eine Zahl(1) oder ein Wort(2) ? &quot;;
    cin&gt;&gt;ZahlOderWort;
    cout&lt;&lt;&quot;\n&quot;;

    if(ZahlOderWort == 1)
       { // A
        int welcheZahl;
        cout&lt;&lt;&quot; Welche Zahl? &quot;;
        cin&gt;&gt; welcheZahl;
        cout&lt;&lt;&quot; Wie oft? &quot;;
        cin&gt;&gt;wieOft;
        cout&lt;&lt;&quot;\n&quot;;

            while(wieOft &gt; 0)
             { // B
              cout&lt;&lt;&quot; &quot; &lt;&lt;welcheZahl &lt;&lt;&quot;\n&quot;;
              wieOft--;
             } // B

         cout&lt;&lt;&quot;\n Ende \n\n&quot;;

         } // A
    else
        { // A
         if(ZahlOderWort == 2);
           { // B
            string welchesWort; // string-Variable

            cout&lt;&lt;&quot; Welches Wort? &quot;;
            cin&gt;&gt;welchesWort;
            cout&lt;&lt;&quot; Wie oft? &quot;;
            cin&gt;&gt;wieOft;
            cout&lt;&lt;&quot;\n&quot;;

            int tmp = 0;

                while(wieOft &gt; 0)
                { // C
                  cout&lt;&lt;&quot; &quot; &lt;&lt;++tmp &lt;&lt;&quot;. &quot; &lt;&lt;welchesWort &lt;&lt;&quot;\n&quot;;
                  wieOft--;
                } // C
            cout&lt;&lt;&quot;\n Ende\n\n&quot;;
            } // B
            else // &lt;&lt;&lt;--- GENAU HIER SPUCKT DEV-CPP EINEN FEHLER AUS
               { // D
                cout&lt;&lt;&quot; Test&quot;; // Test-Ausdruck
               } // D
         } // A

    system(&quot;PAUSE&quot;);
    return EXIT_SUCCESS;
}
</code></pre>
<p>Danke <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1257616</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1257616</guid><dc:creator><![CDATA[Floko]]></dc:creator><pubDate>Sun, 01 Apr 2007 19:51:44 GMT</pubDate></item><item><title><![CDATA[Reply to Wieder mal IF und Else on Sun, 01 Apr 2007 20:24:15 GMT]]></title><description><![CDATA[<p>Hallo</p>
<blockquote>
<p>find ich den Fehler im Code nicht.</p>
</blockquote>
<p>Wenn du noch dazugeschrieben hättest was dein Programm überhaupt machen soll und was bei welcher Eingabe nicht so läuft wie du gerne hättest würde dir vielleicht auch jemand helfen können.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1257633</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1257633</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Sun, 01 Apr 2007 20:24:15 GMT</pubDate></item><item><title><![CDATA[Reply to Wieder mal IF und Else on Sun, 01 Apr 2007 20:30:12 GMT]]></title><description><![CDATA[<p>&quot;if&quot; in der zeile 41: was soll des heissen?<br />
ähm... semikolon zu viel?...</p>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/7971">@akari</a>:<br />
aja, grundsätzlich bei so sachen würd ich dir da schon zustimmen, <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="😃"
    /><br />
aber hier kann der mensch ja gar nich sagen &quot;bei welcher eingabe irgendetwas schief läuft&quot;, weil ja ebn gar nichts läuft: der kollege kommt mit den fehlermeldungen des compilers nich klar, was soll er da sonst noch dazu groß erzählen? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1257634</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1257634</guid><dc:creator><![CDATA[Andrey]]></dc:creator><pubDate>Sun, 01 Apr 2007 20:30:12 GMT</pubDate></item><item><title><![CDATA[Reply to Wieder mal IF und Else on Sun, 01 Apr 2007 20:46:44 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">if(ZahlOderWort == 2);
</code></pre>
<p>Semicolon noticed right behind the parenthesis (')'): Are you sure of that?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1257642</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1257642</guid><dc:creator><![CDATA[Optimised Compiler]]></dc:creator><pubDate>Sun, 01 Apr 2007 20:46:44 GMT</pubDate></item><item><title><![CDATA[Reply to Wieder mal IF und Else on Sun, 01 Apr 2007 20:59:46 GMT]]></title><description><![CDATA[<p>Vielen Dank für Eure Antworten,</p>
<p>... man ärgere ich mich jetzt, das der Fehler ein lächerlicher Schreibfehler ist.</p>
<p>Gut, ich wusste schon wie der Code Arbeitet nur dachte ich Ihr compiliert Ihn.</p>
<p>Na gut, vielen Dank</p>
<p>@Optimised Compiler</p>
<p>thanks for your answer, where one can buy you ?<img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f60b.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_savoring_food"
      title=":yum:"
      alt="😋"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1257649</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1257649</guid><dc:creator><![CDATA[Floko]]></dc:creator><pubDate>Sun, 01 Apr 2007 20:59:46 GMT</pubDate></item><item><title><![CDATA[Reply to Wieder mal IF und Else on Sun, 01 Apr 2007 21:04:37 GMT]]></title><description><![CDATA[<p>Andrey schrieb:</p>
<blockquote>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/7971">@akari</a>:<br />
aja, grundsätzlich bei so sachen würd ich dir da schon zustimmen, <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="😃"
    /><br />
aber hier kann der mensch ja gar nich sagen &quot;bei welcher eingabe irgendetwas schief läuft&quot;, weil ja ebn gar nichts läuft: der kollege kommt mit den fehlermeldungen des compilers nich klar, was soll er da sonst noch dazu groß erzählen? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /></p>
</blockquote>
<p>Fehlermeldungen des Compilers gehören deutlich in die Problembeschreibung. So ein Kommentar irgendwo im Quellcode wird schnell überlesen.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1257652</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1257652</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Sun, 01 Apr 2007 21:04:37 GMT</pubDate></item><item><title><![CDATA[Reply to Wieder mal IF und Else on Mon, 02 Apr 2007 11:32:36 GMT]]></title><description><![CDATA[<p>akari schrieb:</p>
<blockquote>
<p>Fehlermeldungen des Compilers gehören deutlich in die Problembeschreibung.</p>
</blockquote>
<p>dat hätt in der tat nich geschadet :p</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1257856</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1257856</guid><dc:creator><![CDATA[Andrey]]></dc:creator><pubDate>Mon, 02 Apr 2007 11:32:36 GMT</pubDate></item></channel></rss>