<?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[Probleme mit (?) scanf]]></title><description><![CDATA[<p>Hi!</p>
<p>Hab ein Problem mit folgendem Quelltext!!!</p>
<pre><code>#include &lt;stdio.h&gt;

int main(void) {

    Anfang:

    int Wurzel, x=0;
    int z;
    float y=1;
    printf(&quot;\n\n\tZu errechnende Wurzel eingeben: &quot;);
    scanf(&quot;%d&quot;,&amp;Wurzel);
    getchar();
    while(x&lt;=200) {
                  y=(y+Wurzel/y)/2;
                  x++;
                  }
    printf(&quot;\n\n\tDie Wurzel von %d ist %f.&quot;,Wurzel,y);

    Schluss:

    printf(&quot;\n\n\t(B)eenden / (N)ochmal&quot;);
    printf(&quot;\n\tIhre Eingabe (B/N): &quot;);
    scanf(&quot;%c&quot;,&amp;z);
    getchar();
    if(z=='n' || z=='N') {
              goto Anfang;
              } else if(z=='b' || z=='B') {
                     return 0;
                     } else {
         printf(&quot;\n\n\t\aFalsche Eingabe. Bitte wiederholen!&quot;);
         goto Schluss;
         }
}
</code></pre>
<p>Also das mit den Wurzeln usw funzt, nur wenn ich das Programm ausführe kommt immer wenn ich am Schluss eingebe, ob ich nochmal will oder nicht &quot;Falsche Eingabe. Bitte wiederholen!&quot;, egal was ich eingebe für z.<br />
Dass ich den gesamten Quelltext gepostet habe liegt daran, dass wenn ich nur den Quellcode ab &quot;Schluss:&quot; (in einer anderen Datei) kompiliere, es funktioniert.</p>
<p>Kann mir bitte jemand helfen? Bin echt am verzweifeln!!!</p>
<p>MfG,</p>
<p>Dago</p>
<p>P.S.: Ich verwende den Compiler Dev-C++ von <a href="http://bloodshed.net" rel="nofollow">bloodshed.net</a></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/134147/probleme-mit-scanf</link><generator>RSS for Node</generator><lastBuildDate>Fri, 28 Aug 2026 08:35:21 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/134147.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 23 Jan 2006 21:42:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Probleme mit (?) scanf on Mon, 23 Jan 2006 21:42:27 GMT]]></title><description><![CDATA[<p>Hi!</p>
<p>Hab ein Problem mit folgendem Quelltext!!!</p>
<pre><code>#include &lt;stdio.h&gt;

int main(void) {

    Anfang:

    int Wurzel, x=0;
    int z;
    float y=1;
    printf(&quot;\n\n\tZu errechnende Wurzel eingeben: &quot;);
    scanf(&quot;%d&quot;,&amp;Wurzel);
    getchar();
    while(x&lt;=200) {
                  y=(y+Wurzel/y)/2;
                  x++;
                  }
    printf(&quot;\n\n\tDie Wurzel von %d ist %f.&quot;,Wurzel,y);

    Schluss:

    printf(&quot;\n\n\t(B)eenden / (N)ochmal&quot;);
    printf(&quot;\n\tIhre Eingabe (B/N): &quot;);
    scanf(&quot;%c&quot;,&amp;z);
    getchar();
    if(z=='n' || z=='N') {
              goto Anfang;
              } else if(z=='b' || z=='B') {
                     return 0;
                     } else {
         printf(&quot;\n\n\t\aFalsche Eingabe. Bitte wiederholen!&quot;);
         goto Schluss;
         }
}
</code></pre>
<p>Also das mit den Wurzeln usw funzt, nur wenn ich das Programm ausführe kommt immer wenn ich am Schluss eingebe, ob ich nochmal will oder nicht &quot;Falsche Eingabe. Bitte wiederholen!&quot;, egal was ich eingebe für z.<br />
Dass ich den gesamten Quelltext gepostet habe liegt daran, dass wenn ich nur den Quellcode ab &quot;Schluss:&quot; (in einer anderen Datei) kompiliere, es funktioniert.</p>
<p>Kann mir bitte jemand helfen? Bin echt am verzweifeln!!!</p>
<p>MfG,</p>
<p>Dago</p>
<p>P.S.: Ich verwende den Compiler Dev-C++ von <a href="http://bloodshed.net" rel="nofollow">bloodshed.net</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/974477</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/974477</guid><dc:creator><![CDATA[Dagophil]]></dc:creator><pubDate>Mon, 23 Jan 2006 21:42:27 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit (?) scanf on Tue, 24 Jan 2006 07:18:39 GMT]]></title><description><![CDATA[<p>Erstens solltest du cpp-Tags für deine Codes verwenden, dann sieht das ganze viel übersichtlicher aus.</p>
<p>Zweitens: Vergiss das goto - verwende lieber Schleifenstrukturen (do-while)</p>
<p>Drittens: Wenn du mit &quot;%c&quot; eingibst, solltest du auch char's verwenden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/974625</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/974625</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Tue, 24 Jan 2006 07:18:39 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit (?) scanf on Tue, 24 Jan 2006 13:05:20 GMT]]></title><description><![CDATA[<p>Danke, ich werds mal probieren.<br />
Wegen diesem C/C++ Tag, wusste nicht, ob man unten auf &quot;Code&quot; oder auf &quot;C/C++&quot; klicken muss, hab halt Code genommen (50:50 Chance :D)</p>
<p>MfG</p>
<p>Dagophil</p>
]]></description><link>https://www.c-plusplus.net/forum/post/974902</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/974902</guid><dc:creator><![CDATA[Dagophil]]></dc:creator><pubDate>Tue, 24 Jan 2006 13:05:20 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit (?) scanf on Tue, 24 Jan 2006 13:35:50 GMT]]></title><description><![CDATA[<p>Dagophil schrieb:</p>
<blockquote>
<p>Wegen diesem C/C++ Tag, wusste nicht, ob man unten auf &quot;Code&quot; oder auf &quot;C/C++&quot; klicken muss, hab halt Code genommen (50:50 Chance :D)</p>
</blockquote>
<p>Du kannst das ganze vor dem Abschicken mit Vorschau anschauen und nochmal editieren.. Dort sieht man wie das endgültige Post ausschauen wird <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f576.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--sunglasses"
      title=":sunglasses:"
      alt="🕶"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/974948</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/974948</guid><dc:creator><![CDATA[PuppyOnAcid]]></dc:creator><pubDate>Tue, 24 Jan 2006 13:35:50 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit (?) scanf on Tue, 24 Jan 2006 13:37:24 GMT]]></title><description><![CDATA[<p>Dein Code da oben ist hässlichstes C und von hässlichem C++ meilen entfernt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/974953</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/974953</guid><dc:creator><![CDATA[Any]]></dc:creator><pubDate>Tue, 24 Jan 2006 13:37:24 GMT</pubDate></item></channel></rss>