<?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[Wurzel]]></title><description><![CDATA[<p>hey!<br />
ich als anfänger hab mir mal gedacht<br />
wie symboliesiere ich eine Wurzel.<br />
ein Quadrat ist klar: Zahl*Zahl<br />
aber Wurzel ist da schon unklarer.<br />
Nun, da dacht ich mir: schreibn wir halt n programm.<br />
hier der scheiternde versuch (omg):</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
using namespace std;

int main()
{
    int intAusgabe;       
    int intEingabe=intAusgabe*intAusgabe;

    cout&lt;&lt;&quot;Geben Sie eine Zahl ein! \t&quot;;
    cin&gt;&gt;intEingabe;
    cout&lt;&lt;&quot;\n&quot;&lt;&lt;intAusgabe&lt;&lt;&quot;\n\n&quot;;
    system(&quot;PAUSE&quot;);
    return EXIT_SUCCESS;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/124354/wurzel</link><generator>RSS for Node</generator><lastBuildDate>Sun, 23 Aug 2026 21:58:52 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/124354.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 26 Oct 2005 17:30:34 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Wurzel on Wed, 26 Oct 2005 17:30:34 GMT]]></title><description><![CDATA[<p>hey!<br />
ich als anfänger hab mir mal gedacht<br />
wie symboliesiere ich eine Wurzel.<br />
ein Quadrat ist klar: Zahl*Zahl<br />
aber Wurzel ist da schon unklarer.<br />
Nun, da dacht ich mir: schreibn wir halt n programm.<br />
hier der scheiternde versuch (omg):</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
using namespace std;

int main()
{
    int intAusgabe;       
    int intEingabe=intAusgabe*intAusgabe;

    cout&lt;&lt;&quot;Geben Sie eine Zahl ein! \t&quot;;
    cin&gt;&gt;intEingabe;
    cout&lt;&lt;&quot;\n&quot;&lt;&lt;intAusgabe&lt;&lt;&quot;\n\n&quot;;
    system(&quot;PAUSE&quot;);
    return EXIT_SUCCESS;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/901366</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/901366</guid><dc:creator><![CDATA[XaTrIxX]]></dc:creator><pubDate>Wed, 26 Oct 2005 17:30:34 GMT</pubDate></item><item><title><![CDATA[Reply to Wurzel on Wed, 26 Oct 2005 17:34:37 GMT]]></title><description><![CDATA[<p>Was klappt genau nicht und wie was hat das mit Wurzeln zu tun?</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
using namespace std;

int main()
{
    int intAusgabe;      
    int intEingabe=intAusgabe*intAusgabe; // du schreibst Speichermüll² in Eingabe

    cout&lt;&lt;&quot;Geben Sie eine Zahl ein! \t&quot;;
    cin&gt;&gt;intEingabe;                      // jetzt wird Speichermüll² wieder überschrieben
    cout&lt;&lt;&quot;\n&quot;&lt;&lt;intAusgabe&lt;&lt;&quot;\n\n&quot;;       // da ist aber noch Speichermüll drin
    system(&quot;PAUSE&quot;);
    return EXIT_SUCCESS;
}
</code></pre>
<p>Du musst Ausgabe einen Wert verpassen, sonst steht da das, was gerade and er Stelle zufällig im Speicher noch rumgammelte.<br />
Es müsste in &lt;cmath&gt; eine Funktion für die Wurzel geben. Schau doch da mal nach.</p>
<p>Panke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/901370</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/901370</guid><dc:creator><![CDATA[Panke]]></dc:creator><pubDate>Wed, 26 Oct 2005 17:34:37 GMT</pubDate></item><item><title><![CDATA[Reply to Wurzel on Wed, 26 Oct 2005 17:36:22 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;math.h&gt;
using namespace std;

int main()
{  
    cout&lt;&lt;&quot;Geben Sie eine Zahl ein! \t&quot;;

    int intEingabe;
    cin&gt;&gt;intEingabe;

    const int quadrat = intEingabe * intEingabe;      
    cout&lt;&lt;&quot;\n&quot;&lt;&lt;quadrat&lt;&lt;&quot;\n\n&quot;;

    const double wurzel = sqrt( intEingabe);
    cout&lt;&lt;&quot;\n&quot;&lt;&lt;wurzel&lt;&lt;&quot;\n\n&quot;;

    system(&quot;PAUSE&quot;);
    return EXIT_SUCCESS;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/901373</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/901373</guid><dc:creator><![CDATA[niemand]]></dc:creator><pubDate>Wed, 26 Oct 2005 17:36:22 GMT</pubDate></item><item><title><![CDATA[Reply to Wurzel on Wed, 26 Oct 2005 17:37:19 GMT]]></title><description><![CDATA[<p>cmath???<br />
was IST cmath überhaupt...sorry aber...<br />
wo find ich das eigentlich?!<br />
ist das schlimm, dass ich das nicht kenn?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/901374</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/901374</guid><dc:creator><![CDATA[XaTrIxX]]></dc:creator><pubDate>Wed, 26 Oct 2005 17:37:19 GMT</pubDate></item><item><title><![CDATA[Reply to Wurzel on Wed, 26 Oct 2005 17:38:54 GMT]]></title><description><![CDATA[<p>Hallo,<br />
Mir ist zwar dein Gedanke nicht ganz klar, den du mit diesem Programm ausdrücken willst, aber:</p>
<p>1. Variablen, die lokal definiert werden, haben bei ihrer Definition einen <em>undefinierten</em> Anfangswert. =&gt; Du initialisierst intEingabe mit dem <em>undefinierten</em> Wert von intAusgabe * intAusgabe... (der noch dazu später wieder überschrieben wird...)</p>
<p>Btw.: Um quadratwurzeln zu ziehen, kannst du dich auch der Funktion std::sqrt() aus cmath bedienen :).</p>
<p>/edit: man bin ich lahm <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    />...</p>
<p>Gruß Caipi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/901375</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/901375</guid><dc:creator><![CDATA[Caipi]]></dc:creator><pubDate>Wed, 26 Oct 2005 17:38:54 GMT</pubDate></item><item><title><![CDATA[Reply to Wurzel on Wed, 26 Oct 2005 17:40:17 GMT]]></title><description><![CDATA[<p>&lt;cmath&gt; ist eine Headerdatei.</p>
<pre><code class="language-cpp">#include &lt;cmath&gt;

int a = 25;
int b = std:sqrt(a);

// b ist nu 5
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/901377</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/901377</guid><dc:creator><![CDATA[Panke]]></dc:creator><pubDate>Wed, 26 Oct 2005 17:40:17 GMT</pubDate></item><item><title><![CDATA[Reply to Wurzel on Wed, 26 Oct 2005 17:44:43 GMT]]></title><description><![CDATA[<p>^^verstehe...und wo sehe ich was alles in der header drinsteht?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/901386</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/901386</guid><dc:creator><![CDATA[XaTrIxX]]></dc:creator><pubDate>Wed, 26 Oct 2005 17:44:43 GMT</pubDate></item><item><title><![CDATA[Reply to Wurzel on Wed, 26 Oct 2005 17:50:30 GMT]]></title><description><![CDATA[<p>Öffnen oder nach ner Referenz googeln.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/901391</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/901391</guid><dc:creator><![CDATA[Panke]]></dc:creator><pubDate>Wed, 26 Oct 2005 17:50:30 GMT</pubDate></item><item><title><![CDATA[Reply to Wurzel on Wed, 26 Oct 2005 17:51:29 GMT]]></title><description><![CDATA[<p>und was stimmt hier nun wieder nicht?!</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;cmath&gt;
using namespace std;

int main()
{
    int intEingabe;
    cout&lt;&lt;&quot;Geben Sie eine Zahl ein: \t&quot;;
    cin&gt;&gt;intEingabe;
    int intAusgabe=sqrt(intEingabe);
    cout&lt;&lt;&quot;Die Wurzel ihrer Zahl betraegt: \t&quot;&lt;&lt;intAusgabe;
    system(&quot;PAUSE&quot;);
    return EXIT_SUCCESS;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/901393</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/901393</guid><dc:creator><![CDATA[XaTrIxX]]></dc:creator><pubDate>Wed, 26 Oct 2005 17:51:29 GMT</pubDate></item><item><title><![CDATA[Reply to Wurzel on Wed, 26 Oct 2005 17:54:19 GMT]]></title><description><![CDATA[<p>Funktioniert bei mir einwandfrei. Fehlermeldung?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/901397</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/901397</guid><dc:creator><![CDATA[Panke]]></dc:creator><pubDate>Wed, 26 Oct 2005 17:54:19 GMT</pubDate></item><item><title><![CDATA[Reply to Wurzel on Wed, 26 Oct 2005 17:57:26 GMT]]></title><description><![CDATA[<p>ja fehler...<br />
beim kompilieren<br />
ka warum...</p>
<p>aber guck´s dir doch selbst an!</p>
<p><a href="http://img240.imageshack.us/img240/5918/fehler3vy.jpg" rel="nofollow">http://img240.imageshack.us/img240/5918/fehler3vy.jpg</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/901403</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/901403</guid><dc:creator><![CDATA[XaTrIxX]]></dc:creator><pubDate>Wed, 26 Oct 2005 17:57:26 GMT</pubDate></item><item><title><![CDATA[Reply to Wurzel on Wed, 26 Oct 2005 18:02:11 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;cmath&gt;

using namespace std;

int main()
{
    int intEingabe;
    cout&lt;&lt;&quot;Geben Sie eine Zahl ein: \t&quot;;
    cin&gt;&gt;intEingabe;

    double intAusgabe=sqrt(intEingabe);
    cout&lt;&lt;&quot;Die Wurzel ihrer Zahl betraegt: \t&quot;&lt;&lt;intAusgabe;

    system(&quot;PAUSE&quot;);
    return EXIT_SUCCESS;
}
</code></pre>
<p>Versuchs damit. Oder - wenn es denn ein Integer sein muss - mit</p>
<pre><code class="language-cpp">int intAusgabe=(int)sqrt(intEingabe);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/901407</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/901407</guid><dc:creator><![CDATA[Panke]]></dc:creator><pubDate>Wed, 26 Oct 2005 18:02:11 GMT</pubDate></item><item><title><![CDATA[Reply to Wurzel on Wed, 26 Oct 2005 18:05:04 GMT]]></title><description><![CDATA[<p>nee, also hilft beides nicht...ähnliche fehlermeldung...<br />
wtf....</p>
]]></description><link>https://www.c-plusplus.net/forum/post/901410</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/901410</guid><dc:creator><![CDATA[XaTrIxX]]></dc:creator><pubDate>Wed, 26 Oct 2005 18:05:04 GMT</pubDate></item><item><title><![CDATA[Reply to Wurzel on Wed, 26 Oct 2005 18:07:45 GMT]]></title><description><![CDATA[<p>Es gibt eine Wurzelfunktion für floats und für doubles. Dein Compiler kann sich hier nicht entscheiden welche er verwenden soll. Das geht dann so:</p>
<pre><code class="language-cpp">sqrt( static_cast&lt;double&gt;(intEingabe) );
</code></pre>
<p>Gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/post/901414</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/901414</guid><dc:creator><![CDATA[FireFlow]]></dc:creator><pubDate>Wed, 26 Oct 2005 18:07:45 GMT</pubDate></item><item><title><![CDATA[Reply to Wurzel on Wed, 26 Oct 2005 18:07:49 GMT]]></title><description><![CDATA[<p>Der Compiler weiss nicht ob er intEingabe in einen float, einen double oder einen long double konvertieren soll. Du musst ihm dabei helfen, z.B. so:</p>
<pre><code class="language-cpp">double intEingabe;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/901415</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/901415</guid><dc:creator><![CDATA[niemand]]></dc:creator><pubDate>Wed, 26 Oct 2005 18:07:49 GMT</pubDate></item><item><title><![CDATA[Reply to Wurzel on Wed, 26 Oct 2005 18:10:42 GMT]]></title><description><![CDATA[<p>also das funktioniert nun:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;cmath&gt;

using namespace std;

int main()
{
    int intEingabe;
    cout&lt;&lt;&quot;Geben Sie eine Zahl ein: \t&quot;;
    cin&gt;&gt;intEingabe;

    double intAusgabe= sqrt( static_cast&lt;double&gt;(intEingabe) );
    cout&lt;&lt;&quot;Die Wurzel ihrer Zahl betraegt: \t&quot;&lt;&lt;intAusgabe &lt;&lt;&quot;\n\n&quot;;

    system(&quot;PAUSE&quot;);
    return EXIT_SUCCESS;
}
</code></pre>
<p>geht´s eigentlich noch unkomplizierter?!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/901419</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/901419</guid><dc:creator><![CDATA[XaTrIxX]]></dc:creator><pubDate>Wed, 26 Oct 2005 18:10:42 GMT</pubDate></item><item><title><![CDATA[Reply to Wurzel on Wed, 26 Oct 2005 18:25:32 GMT]]></title><description><![CDATA[<p>Bei mir von Anfang an ja. Ansonsten mach es wie niemand sagt und nimm keine Integer sondern nur double.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/901441</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/901441</guid><dc:creator><![CDATA[Panke]]></dc:creator><pubDate>Wed, 26 Oct 2005 18:25:32 GMT</pubDate></item><item><title><![CDATA[Reply to Wurzel on Wed, 26 Oct 2005 18:48:56 GMT]]></title><description><![CDATA[<p>kk alles klar, ty</p>
]]></description><link>https://www.c-plusplus.net/forum/post/901458</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/901458</guid><dc:creator><![CDATA[XaTrIxX]]></dc:creator><pubDate>Wed, 26 Oct 2005 18:48:56 GMT</pubDate></item></channel></rss>