<?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[Source Code Problem]]></title><description><![CDATA[<p>Hallo Freunde,</p>
<p>ich bin gerade dabei C++ zu lernen und wollte so mal aus Spass ein kleines eigenen Programm schreiben...</p>
<p>So wollte ich einen Taschenrechner programmieren und genau dort liegt mein Problem... irgendwie klappt was nicht...</p>
<p>Ich lasse eine Art &quot;Menü&quot; ausgeben und möchte, wenn die jeweilige Zahl die vor der Rechenoperation steht, eingegeben wird, dass dann auch diese Operation ausgeführt wird. Dies hab ich mit if/else gemacht doch irgendiwe lässt sich immer nur addieren aber nicht subtrahieren...</p>
<p>(die 2 anderen Rechenarten hab ich noch nicht mir rein genommen weil schon das mit dem wechsel zwischen addieren und subtrahieren nicht klappt...)</p>
<p>wie gesagt, ich bin noch nicht lang dabei und so könnte mein Source code ein bissel chaotisch aussehen...</p>
<p>Der Code:</p>
<p>#include &lt;iostream&gt;<br />
using namespace std;</p>
<p>int main()<br />
{<br />
int x, y; //Rechnoperationen werden festgelegt - Addition<br />
//Rechenoperation werdern festgelegt - Subtraktion</p>
<p>int addition_1, addition_2; //Das sind die Ziffern für die addition</p>
<p>//Das Menü wird ausgegeben<br />
cout &lt;&lt; &quot;Hallo! \n\n&quot;;<br />
cout &lt;&lt; &quot;Ich rechne Ihnen alles aus was Sie wissen wollen!\n\n&quot;;<br />
cout &lt;&lt; &quot;Was wollen sie berechnen:\n&quot;;<br />
cout &lt;&lt; &quot;\n&quot;;<br />
cout &lt;&lt; &quot;1. Addieren\n&quot;;<br />
cout &lt;&lt; &quot;2. Subtrahieren\n&quot;;<br />
cout &lt;&lt; &quot;3. Multiplizieren\n&quot;;<br />
cout &lt;&lt; &quot;4. Dividieren\n&quot;;</p>
<p>cout &lt;&lt; &quot;\n&quot;;</p>
<p>//1. if-Anwendung -&gt; Addition<br />
{if (cin &gt;&gt; x)<br />
{<br />
cout &lt;&lt; &quot;Welche Zahlen sollen miteinander Addiert werden?\n&quot;;<br />
cin &gt;&gt; addition_1;<br />
cin &gt;&gt; addition_2;</p>
<p>cout &lt;&lt; addition_1 &lt;&lt; &quot; + &quot; &lt;&lt; addition_2 &lt;&lt; &quot; = &quot; &lt;&lt; addition_1 + addition_2;<br />
cin.get();<br />
cout &lt;&lt; &quot;\n&quot;;<br />
}</p>
<p>//2. if-Anwendung -&gt; Subtraktion<br />
if (cin &gt;&gt; y)<br />
{<br />
cout &lt;&lt; &quot;Welche Zahlen sollen Subtrahiert werden?&quot;;<br />
}<br />
}</p>
<p>} return 0;}</p>
<p>Kann mir jemand helfen...</p>
<p>Bei fragen schreibt mich einfach an...</p>
<p>Mfg crew06ZW</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/185684/source-code-problem</link><generator>RSS for Node</generator><lastBuildDate>Thu, 24 Sep 2026 10:20:04 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/185684.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 29 Jun 2007 18:50:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Source Code Problem on Fri, 29 Jun 2007 18:50:21 GMT]]></title><description><![CDATA[<p>Hallo Freunde,</p>
<p>ich bin gerade dabei C++ zu lernen und wollte so mal aus Spass ein kleines eigenen Programm schreiben...</p>
<p>So wollte ich einen Taschenrechner programmieren und genau dort liegt mein Problem... irgendwie klappt was nicht...</p>
<p>Ich lasse eine Art &quot;Menü&quot; ausgeben und möchte, wenn die jeweilige Zahl die vor der Rechenoperation steht, eingegeben wird, dass dann auch diese Operation ausgeführt wird. Dies hab ich mit if/else gemacht doch irgendiwe lässt sich immer nur addieren aber nicht subtrahieren...</p>
<p>(die 2 anderen Rechenarten hab ich noch nicht mir rein genommen weil schon das mit dem wechsel zwischen addieren und subtrahieren nicht klappt...)</p>
<p>wie gesagt, ich bin noch nicht lang dabei und so könnte mein Source code ein bissel chaotisch aussehen...</p>
<p>Der Code:</p>
<p>#include &lt;iostream&gt;<br />
using namespace std;</p>
<p>int main()<br />
{<br />
int x, y; //Rechnoperationen werden festgelegt - Addition<br />
//Rechenoperation werdern festgelegt - Subtraktion</p>
<p>int addition_1, addition_2; //Das sind die Ziffern für die addition</p>
<p>//Das Menü wird ausgegeben<br />
cout &lt;&lt; &quot;Hallo! \n\n&quot;;<br />
cout &lt;&lt; &quot;Ich rechne Ihnen alles aus was Sie wissen wollen!\n\n&quot;;<br />
cout &lt;&lt; &quot;Was wollen sie berechnen:\n&quot;;<br />
cout &lt;&lt; &quot;\n&quot;;<br />
cout &lt;&lt; &quot;1. Addieren\n&quot;;<br />
cout &lt;&lt; &quot;2. Subtrahieren\n&quot;;<br />
cout &lt;&lt; &quot;3. Multiplizieren\n&quot;;<br />
cout &lt;&lt; &quot;4. Dividieren\n&quot;;</p>
<p>cout &lt;&lt; &quot;\n&quot;;</p>
<p>//1. if-Anwendung -&gt; Addition<br />
{if (cin &gt;&gt; x)<br />
{<br />
cout &lt;&lt; &quot;Welche Zahlen sollen miteinander Addiert werden?\n&quot;;<br />
cin &gt;&gt; addition_1;<br />
cin &gt;&gt; addition_2;</p>
<p>cout &lt;&lt; addition_1 &lt;&lt; &quot; + &quot; &lt;&lt; addition_2 &lt;&lt; &quot; = &quot; &lt;&lt; addition_1 + addition_2;<br />
cin.get();<br />
cout &lt;&lt; &quot;\n&quot;;<br />
}</p>
<p>//2. if-Anwendung -&gt; Subtraktion<br />
if (cin &gt;&gt; y)<br />
{<br />
cout &lt;&lt; &quot;Welche Zahlen sollen Subtrahiert werden?&quot;;<br />
}<br />
}</p>
<p>} return 0;}</p>
<p>Kann mir jemand helfen...</p>
<p>Bei fragen schreibt mich einfach an...</p>
<p>Mfg crew06ZW</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1315246</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1315246</guid><dc:creator><![CDATA[Crew06ZW]]></dc:creator><pubDate>Fri, 29 Jun 2007 18:50:21 GMT</pubDate></item><item><title><![CDATA[Reply to Source Code Problem on Fri, 29 Jun 2007 19:28:44 GMT]]></title><description><![CDATA[<p>Machs einfach und nicht so umständlich ...</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &quot;header.h&quot; //..
//sonstige Headerdateien wie windows.h ...
void start_program();

int main()
{
	//Variablendefinition
	int a, b; //Hauptvariablen
	char chars; //+, -, *, /, ^
	char choose; //A,B,C
	double zahl = 10, x = 3;
	//Code
	std::cout&lt;&lt;&quot;~ Matheprogramm ~&quot;&lt;&lt;std::endl;
	std::cout&lt;&lt;&quot;A. Start\nB.Readme\nC. \&quot;Zehn_hoch\&quot;\nD.Programm schliessen\n\nAuswahl: &quot;;
	std::cin&gt;&gt;choose;

		switch(choose)
	{

	case 'A':
		std::cout&lt;&lt;&quot;\n&lt;Zurueck ins Hauptmenue mit 'X'\nSchreibe hier eine aus zwei Zahlen bestehende Rechnung hinein.\nMoeglichkeiten:\n-&lt;+&gt;(x + x)\n- &lt;-&gt;(x - x)\n- &lt;*&gt;(x * x)\n- &lt;/&gt;(x / x)\n- &lt;^&gt;(x^n)\n\n&quot;&lt;&lt;std::endl;
	std::cout&lt;&lt;&quot;Rechnung bitte hier eingeben: &quot;;
	std::cin&gt;&gt;a;
	std::cin&gt;&gt;chars;
	std::cin&gt;&gt;b;
	switch(chars)
	{
		case '+':
			std::cout&lt;&lt;add(a,b)&lt;&lt;std::endl;
			break;
		case '-':
			std::cout&lt;&lt;mins(a,b)&lt;&lt;std::endl;
			break;
		case '*':
			std::cout&lt;&lt;multi(a,b)&lt;&lt;std::endl;
			break;
		case '/':
			std::cout&lt;&lt;divS(a,b)&lt;&lt;std::endl;
			break;
		case '^':
			std::cout&lt;&lt;power_of(a,b)&lt;&lt;std::endl;
			break;
	}	
	case 'B':
		readme();
		break;
	case 'C': //gelöscht^^
	case 'D':
		exit(0);
	}

	Sleep(8888);
	std::cin.get();
	return 0;
}
</code></pre>
<p>Mit freundlichen Grüßen,<br />
Daniel</p>
<p>Edit:<br />
Sry hab die headerdatei vergessen^^</p>
<pre><code class="language-cpp">#ifndef MATHE_H
#define MATHE_H

//Funktionen - Standard
void readme()
{
	std::cout&lt;&lt;&quot;----------------------------------&quot;&lt;&lt;&quot;\n&quot;&lt;&lt;&quot;Beschreibung...\n&quot;&lt;&lt;&quot;----------------------------------&quot;&lt;&lt;std::endl&lt;&lt;std::endl;
}
void close_program()
{
	std::cout&lt;&lt;&quot;\n~ Dieses Programm wird nun beendet ~&quot;&lt;&lt;std::endl;
	Sleep(5000);
	exit(0);
}

//Rechnungsarten
int add(int a, int b)
{
	return a + b;
}
int mins(int a, int b)
{
	return a - b;
}
int divS(int a, int b)
{
		return a / b;
}
int multi(int a, int b)
{
	return a * b;
}
int power_of(int a, int b)
{
	int tmp = 0;
	while(tmp &lt; b)
	{
		++tmp;
		a *= a;
	}
	return a;
}
#endif
</code></pre>
<p>Edit 2: Hab ne funktion gelöscht, war eine Funktion im schlechten Stil^^</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1315264</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1315264</guid><dc:creator><![CDATA[XP*]]></dc:creator><pubDate>Fri, 29 Jun 2007 19:28:44 GMT</pubDate></item><item><title><![CDATA[Reply to Source Code Problem on Fri, 29 Jun 2007 19:55:31 GMT]]></title><description><![CDATA[<p>Danke für deine Antwort!</p>
<p>Ich muss mich jezze nur mal versuchen reinzudenken...</p>
<p>Da ich ja wie gesagt ein ziemlicher Anfänger bin weiß ich bei vielen nicht was du da getan hast!</p>
<p>Ma gucken... Danke schön!^^</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1315279</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1315279</guid><dc:creator><![CDATA[Crew06ZW]]></dc:creator><pubDate>Fri, 29 Jun 2007 19:55:31 GMT</pubDate></item><item><title><![CDATA[Reply to Source Code Problem on Fri, 29 Jun 2007 20:10:02 GMT]]></title><description><![CDATA[<p>Crew06ZW schrieb:</p>
<blockquote>
<p>Danke für deine Antwort!</p>
<p>Ich muss mich jezze nur mal versuchen reinzudenken...</p>
<p>Da ich ja wie gesagt ein ziemlicher Anfänger bin weiß ich bei vielen nicht was du da getan hast!</p>
<p>Ma gucken... Danke schön!^^</p>
</blockquote>
<p>Kein Problem <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>Ich kanns von mir aus ein bisschen erläutern...</p>
<pre><code class="language-cpp">int a, b, myZeichen;
std::cin&gt;&gt;a;
std::cin&gt;&gt;myZeichen;
std::cin&gt;&gt;b;
</code></pre>
<p>Ich weiß nicht, ob ich es so nach gutem Stil mache, aber is ja hauptsache egal^^<br />
Das könntest du dir so vorstellen:</p>
<pre><code>a    myZeichen    b
12       +        12
</code></pre>
<p>Also jetzt muss ich nur noch wissen,was ich machen will,wenn myZeichen zbsp. ein &quot;-&quot;, &quot;/&quot; oder sonstiges ist.</p>
<p>Dazu schreibe ich einmal ne switch-Anweisung:</p>
<pre><code class="language-cpp">switch(myZeichen)
{
case '+':
myAdd(a, b); //Ruft die Funktion myAdd auf.. später mehr dazu
break; //aus der Anweisung herausberechen
case '-':
myMin(a, b);
break;
default:
std::cout&lt;&lt;&quot;Error ...&quot;&lt;&lt;std::endl;
}
</code></pre>
<p>So, das ist nun auch erledigt.<br />
Nun aber brauchen wir die Funktionen dazu:</p>
<pre><code class="language-cpp">int myAdd(int a, int b)
{
int summe = a + b;
return summe;
}
</code></pre>
<pre><code class="language-cpp">int myMin(int a, int b)
{
int summe = a - b;
return summe;
}
</code></pre>
<p>Die Funktionen jedoch solltest du außerhalb von der Funktion &quot;main()&quot; deklarieren od. Definieren:</p>
<pre><code class="language-cpp">#include &lt;xxxxxx&gt; //Includes der Datei

void xx(int a); //Deklarieren

int main()
{
//...
return 0;
}

void xx(int a)
{
return a = a + 2; //Definieren der Funktion
}
</code></pre>
<p>Ich hoffe,dass es um einiges klarer wurde <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>Mit freundlichen Grüßen,<br />
Daniel</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1315288</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1315288</guid><dc:creator><![CDATA[XP*]]></dc:creator><pubDate>Fri, 29 Jun 2007 20:10:02 GMT</pubDate></item><item><title><![CDATA[Reply to Source Code Problem on Fri, 29 Jun 2007 20:19:42 GMT]]></title><description><![CDATA[<p>XP^ schrieb:</p>
<blockquote>
<pre><code class="language-cpp">int a, b, myZeichen;
std::cin&gt;&gt;a;
std::cin&gt;&gt;myZeichen;
std::cin&gt;&gt;b;
</code></pre>
</blockquote>
<p>Wenn du myZeichen als int deklarierst geht das schief ... das muss schon car sein.</p>
<p>btw: was hast du gegen std::pow() ?<br />
EDIT://<br />
davon abgesehen dass deine Potenzfunktion wohl nicht das erwartete Ergebniss liefert ...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1315292</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1315292</guid><dc:creator><![CDATA[darthdespotism]]></dc:creator><pubDate>Fri, 29 Jun 2007 20:19:42 GMT</pubDate></item><item><title><![CDATA[Reply to Source Code Problem on Fri, 29 Jun 2007 20:29:33 GMT]]></title><description><![CDATA[<p>Ah.... okay...</p>
<p>Das hilft...</p>
<p>Danke schön!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1315297</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1315297</guid><dc:creator><![CDATA[Crew06ZW]]></dc:creator><pubDate>Fri, 29 Jun 2007 20:29:33 GMT</pubDate></item><item><title><![CDATA[Reply to Source Code Problem on Fri, 29 Jun 2007 21:21:19 GMT]]></title><description><![CDATA[<p>darthdespotism schrieb:</p>
<blockquote>
<p>btw: was hast du gegen std::pow() ?</p>
</blockquote>
<p>vieles <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>darthdespotism schrieb:</p>
<blockquote>
<p>davon abgesehen dass deine Potenzfunktion wohl nicht das erwartete Ergebniss liefert ...</p>
</blockquote>
<p>jo, wirklich gehörts so:</p>
<pre><code class="language-cpp">int zahl = 5;
int exponent = 2;
int sum = 0;
for(int i = 0; i != exponent; ++i)
{
sum = zahl * zahl; // Sollte 25 rauskommen^^
}
</code></pre>
<p>Crew06ZW schrieb:</p>
<blockquote>
<p>Ah.... okay...</p>
<p>Das hilft...</p>
<p>Danke schön!</p>
</blockquote>
<p>ich hoffe,dass ich ein wenig helfen konnte <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>
<p>Mit freundlichen Grüßen,<br />
Daniel</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1315336</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1315336</guid><dc:creator><![CDATA[XP*]]></dc:creator><pubDate>Fri, 29 Jun 2007 21:21:19 GMT</pubDate></item><item><title><![CDATA[Reply to Source Code Problem on Sat, 30 Jun 2007 08:09:49 GMT]]></title><description><![CDATA[<p>Türlich! Danke!</p>
<p>Wie habt ihr euch das so alles beigebracht?!</p>
<p>Ich hab eine DVD von Monika Hödl &quot;Jetzt lerne ich C++&quot; und ein Buch<br />
(ISBN 3-82725663-1)...</p>
<p>Wie bzw. womit habt ihr euch das beigebracht?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1315434</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1315434</guid><dc:creator><![CDATA[Crew06ZW]]></dc:creator><pubDate>Sat, 30 Jun 2007 08:09:49 GMT</pubDate></item><item><title><![CDATA[Reply to Source Code Problem on Sat, 30 Jun 2007 08:32:41 GMT]]></title><description><![CDATA[<p>Crew06ZW schrieb:</p>
<blockquote>
<p>Wie bzw. womit habt ihr euch das beigebracht?</p>
</blockquote>
<p>Ich hab mir nach einiger Erfahrung im Objektorientierten mit Delphi &quot;den Stroustrup&quot; (Die C++ Programmiersprache) &quot;gegeben&quot;.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1315441</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1315441</guid><dc:creator><![CDATA[darthdespotism]]></dc:creator><pubDate>Sat, 30 Jun 2007 08:32:41 GMT</pubDate></item><item><title><![CDATA[Reply to Source Code Problem on Sat, 30 Jun 2007 16:42:57 GMT]]></title><description><![CDATA[<p>Crew06ZW schrieb:</p>
<blockquote>
<p>Wie bzw. womit habt ihr euch das beigebracht?</p>
</blockquote>
<p>Fang lieber mit einer niedrigeren Programmiersprache an, wie zBsp. &quot;Delphi&quot;, &quot;Visual Basic&quot; oder von mir aus &quot;Perl&quot;.</p>
<p>In C/C++ geht es eher um das Verstehen der Syntax und logisches Denken, als um irgendein &quot;schnelles&quot; Einsteigen in die C++-Programmierung.</p>
<p>Greif lieber zu einer anderen Sprache, das ich nur mein Vorschlag an dich, sonst wirst du in späteren Kapiteln in C++ schwierigkeiten bekommen, die du selbst nicht mehr lösen kannst und die ganze Zeit herumfragst.</p>
<p>Mit freundlichen Grüßen,<br />
Daniel</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1315759</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1315759</guid><dc:creator><![CDATA[XP*]]></dc:creator><pubDate>Sat, 30 Jun 2007 16:42:57 GMT</pubDate></item><item><title><![CDATA[Reply to Source Code Problem on Thu, 12 Jul 2007 01:28:42 GMT]]></title><description><![CDATA[<p>Hallo erstmal bin neu hier und hab auch sofort mit c++ angefangen und ich seh darin überhaupt gar kein Problem. Hab auch mal eine Lösung für den Taschenrechner. Auserdem finde ich das XP viel zu viel Variablen benutzt das ist in größeren Programmen alles Performanceverlust!</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;

using namespace std;

int main()

{
 char zeichen,neustart;
 int a,b;   

 do
 {   
 system(&quot;cls&quot;);
 cout&lt;&lt;&quot;Herzlich Willkommen zu deinem Taschenrechner!\n&quot;;
 cout&lt;&lt;&quot;Addition\t(A)\n&quot;;
 cout&lt;&lt;&quot;Subtraktion\t(S)\n&quot;;
 cout&lt;&lt;&quot;Division\t(D)\n&quot;;
 cout&lt;&lt;&quot;Multiplikation\t(M)\n&quot;;
 cout&lt;&lt;&quot;Waehlen sie die Rechenart aus!:\t&quot;;
    cin&gt;&gt;zeichen;
 cout&lt;&lt;&quot;::::::::::::::::::::::::::::::::::::::::::::::::::\n\n&quot;;

 switch(zeichen)
    {
      case 'A':   
           cout&lt;&lt;&quot;Zahl1:\t&quot;;
             cin&gt;&gt;a;

           cout&lt;&lt;&quot;Zahl2:\t&quot;;
             cin&gt;&gt;b;

           cout&lt;&lt;&quot;Ihr Ergebniss lautet: &quot;&lt;&lt;a+b&lt;&lt;endl;
           break;
      case 'S':
           cout&lt;&lt;&quot;Zahl1:\t&quot;;
             cin&gt;&gt;a;

           cout&lt;&lt;&quot;Zahl2:\t&quot;;
             cin&gt;&gt;b;

           cout&lt;&lt;&quot;Ihr Ergebniss lautet: &quot;&lt;&lt;a-b&lt;&lt;endl;
           break;
      case 'D':
           cout&lt;&lt;&quot;Zahl1:\t&quot;;
             cin&gt;&gt;a;

           cout&lt;&lt;&quot;Zahl2:\t&quot;;
             cin&gt;&gt;b;

           cout&lt;&lt;&quot;Ihr Ergebniss lautet: &quot;&lt;&lt;a/b&lt;&lt;endl;
           break;
      case 'M':
           cout&lt;&lt;&quot;Zahl1:\t&quot;;
             cin&gt;&gt;a;

           cout&lt;&lt;&quot;Zahl2:\t&quot;;
             cin&gt;&gt;b;

           cout&lt;&lt;&quot;Ihr Ergebniss lautet: &quot;&lt;&lt;a*b&lt;&lt;endl;
           break;

      default:
           cout&lt;&lt;&quot;Falsche Eingabe!&quot;;
     }

        cout &lt;&lt; endl &lt;&lt; endl;
        cout &lt;&lt; &quot;Wollen Sie das Programm neustarten (J)a (N)ein ?\t&quot;;
          cin &gt;&gt; neustart;

    }while(neustart=='j' || neustart =='J');

    return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1323489</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1323489</guid><dc:creator><![CDATA[Phlow]]></dc:creator><pubDate>Thu, 12 Jul 2007 01:28:42 GMT</pubDate></item><item><title><![CDATA[Reply to Source Code Problem on Thu, 12 Jul 2007 01:30:07 GMT]]></title><description><![CDATA[<p>Hallo erstmal bin neu hier und hab auch sofort mit c++ angefangen und ich seh darin überhaupt gar kein Problem. Hab auch mal eine Lösung für den Taschenrechner. Auserdem finde ich das XP viel zu viel Variablen benutzt das ist in größeren Programmen alles Performanceverlust!</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;

using namespace std;

int main()

{
 char zeichen,neustart;
 int a,b;   

 do
 {   
 system(&quot;cls&quot;);
 cout&lt;&lt;&quot;Herzlich Willkommen zu deinem Taschenrechner!\n&quot;;
 cout&lt;&lt;&quot;Addition\t(A)\n&quot;;
 cout&lt;&lt;&quot;Subtraktion\t(S)\n&quot;;
 cout&lt;&lt;&quot;Division\t(D)\n&quot;;
 cout&lt;&lt;&quot;Multiplikation\t(M)\n&quot;;
 cout&lt;&lt;&quot;Waehlen sie die Rechenart aus!:\t&quot;;
    cin&gt;&gt;zeichen;
 cout&lt;&lt;&quot;::::::::::::::::::::::::::::::::::::::::::::::::::\n\n&quot;;

 switch(zeichen)
    {
      case 'A':   
           cout&lt;&lt;&quot;Zahl1:\t&quot;;
             cin&gt;&gt;a;

           cout&lt;&lt;&quot;Zahl2:\t&quot;;
             cin&gt;&gt;b;

           cout&lt;&lt;&quot;Ihr Ergebniss lautet: &quot;&lt;&lt;a+b&lt;&lt;endl;
           break;
      case 'S':
           cout&lt;&lt;&quot;Zahl1:\t&quot;;
             cin&gt;&gt;a;

           cout&lt;&lt;&quot;Zahl2:\t&quot;;
             cin&gt;&gt;b;

           cout&lt;&lt;&quot;Ihr Ergebniss lautet: &quot;&lt;&lt;a-b&lt;&lt;endl;
           break;
      case 'D':
           cout&lt;&lt;&quot;Zahl1:\t&quot;;
             cin&gt;&gt;a;

           cout&lt;&lt;&quot;Zahl2:\t&quot;;
             cin&gt;&gt;b;

           cout&lt;&lt;&quot;Ihr Ergebniss lautet: &quot;&lt;&lt;a/b&lt;&lt;endl;
           break;
      case 'M':
           cout&lt;&lt;&quot;Zahl1:\t&quot;;
             cin&gt;&gt;a;

           cout&lt;&lt;&quot;Zahl2:\t&quot;;
             cin&gt;&gt;b;

           cout&lt;&lt;&quot;Ihr Ergebniss lautet: &quot;&lt;&lt;a*b&lt;&lt;endl;
           break;

      default:
           cout&lt;&lt;&quot;Falsche Eingabe!&quot;;
     }

        cout &lt;&lt; endl &lt;&lt; endl;
        cout &lt;&lt; &quot;Wollen Sie das Programm neustarten (J)a (N)ein ?\t&quot;;
          cin &gt;&gt; neustart;

    }while(neustart=='j' || neustart =='J');

    return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1323491</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1323491</guid><dc:creator><![CDATA[Phlow]]></dc:creator><pubDate>Thu, 12 Jul 2007 01:30:07 GMT</pubDate></item><item><title><![CDATA[Reply to Source Code Problem on Thu, 12 Jul 2007 01:56:45 GMT]]></title><description><![CDATA[<p>Wow! Super Programm, spart Variablen und vermeidet unnötigen Schnickschnack. Hab's sofort kompiliert und damit meinen Windowstaschenrechner (calc.exe) ersetzt!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1323494</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1323494</guid><dc:creator><![CDATA[XaTrIxX]]></dc:creator><pubDate>Thu, 12 Jul 2007 01:56:45 GMT</pubDate></item><item><title><![CDATA[Reply to Source Code Problem on Thu, 12 Jul 2007 04:39:54 GMT]]></title><description><![CDATA[<p>Phlow schrieb:</p>
<blockquote>
<p>Auserdem finde ich das XP viel zu viel Variablen benutzt das ist in größeren Programmen alles Performanceverlust!</p>
</blockquote>
<p>LOL. Ne.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1323499</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1323499</guid><dc:creator><![CDATA[mein pups stinkt]]></dc:creator><pubDate>Thu, 12 Jul 2007 04:39:54 GMT</pubDate></item><item><title><![CDATA[Reply to Source Code Problem on Thu, 12 Jul 2007 05:58:39 GMT]]></title><description><![CDATA[<p>XaTrIxX schrieb:</p>
<blockquote>
<p>Wow! Super Programm, spart Variablen und vermeidet unnötigen Schnickschnack. Hab's sofort kompiliert und damit meinen Windowstaschenrechner (calc.exe) ersetzt!</p>
</blockquote>
<p>Wtf?!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1323520</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1323520</guid><dc:creator><![CDATA[Konrad Rudolph]]></dc:creator><pubDate>Thu, 12 Jul 2007 05:58:39 GMT</pubDate></item></channel></rss>