<?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[c++ BMI Rechner]]></title><description><![CDATA[<p>HALLO ich muss für die schule einen bmi rechner programmieren hab ich geschafft und läuft.</p>
<p>Doch ich wollte noch eine weiter Option hinzufügen, dass man seinn Alter noch eingeben muss.</p>
<pre><code>#include &lt;iostream&gt; 
#include &lt;windows.h&gt;
#include &lt;iomanip&gt;

using namespace std;
const int MAX = 80;

int main () 
{
	float gewicht, grosse, helf, bmiH, bmi ;
	char alter [MAX];

	cout &lt;&lt; &quot;Geben Sie ihre Groesse ein: &quot;;
	cin &gt;&gt; grosse;
	cout &lt;&lt; &quot;Ihre grosse betreagt: &quot; &lt;&lt; grosse ;

cout &lt;&lt; endl;

	cout &lt;&lt;&quot;Geben Sie ihr Gewicht ein: &quot; ;
	cin &gt;&gt; gewicht;

cout &lt;&lt; endl;

	cout &lt;&lt; &quot;Geben Sie ihr Alter ein: &quot;;
	cin.getline (alter, MAX);
	cin &gt;&gt; alter;

	helf = grosse * grosse;

	bmiH = gewicht/ helf ;
	bmi = bmiH * 10000;

	cout &lt;&lt; endl;

	cout &lt;&lt; &quot;Ihr Bmi liegt bei: &quot; &lt;&lt; bmi &lt;&lt; endl;

	cout &lt;&lt; endl;	

	if (alter [MAX] ==  '16' &amp;&amp; bmi &lt;= 18 )
		{
			cout &lt;&lt; &quot;Sie sind Untergewichtig Sie sollten mal einbsichen mehr reinhauen&quot; &lt;&lt; endl;
		}
		 else if (alter [MAX] == 16 &amp;&amp; bmi == 19||20||21||22||23||24 )
			{
				cout &lt;&lt; &quot;Sieh haben ein normales Gewicht weiter so&quot;&lt;&lt;endl;
			}
		 else if (alter [MAX] == 16 &amp;&amp; bmi == 25||26||27||28 )
		{
			cout &lt;&lt; &quot;Du bist leicht pummelig geh ma joggen&quot;&lt;&lt;endl;
			}	
			else if (alter [MAX] == 16 &amp;&amp; bmi &gt;29)
			{
				cout &lt;&lt; &quot;DU FETTSACK GEH MA ABNEHMEN&quot; &lt;&lt; endl;
				}	
	 else if (alter [MAX] == 17 &amp;&amp; bmi &lt;= 18)
	{
		cout &lt;&lt; &quot;Sie sind Untergewichtig Sie sollten mal einbsichen mehr reinhauen&quot;&lt;&lt;endl;
	}
	 else if (alter [MAX] == 17 &amp;&amp; bmi == 19||20||21||22||23||24)
	{
		cout &lt;&lt; &quot;Sieh haben ein normales Gewicht weiter so&quot;&lt;&lt;endl;
	}
	 else if (alter [MAX] == 17 &amp;&amp; bmi == 25||26||27||28)
	{
		cout &lt;&lt; &quot;Du bist leich pummelig geh ma joggen&quot;&lt;&lt;endl;
	}
		else if (alter [MAX] == 18||19||20||21||22||23||24 &amp;&amp; bmi &lt;= 18)
		{
			cout &lt;&lt; &quot;Sie sind Untergewichtig Sie sollten mal einbsichen mehr reinhauen &quot; &lt;&lt; endl;
		}
		else if (alter [MAX] == 18||19||20||21||22||23||24 &amp;&amp; bmi == 19||20||21||22||23||24)
		{
			cout &lt;&lt; &quot;Sieh haben ein normales Gewicht weiter so&quot; &lt;&lt; endl;
		}	
		else if (alter [MAX] == 18||19||20||21||22||23||24 &amp;&amp; bmi == 25||26||27||28)
		{
			cout &lt;&lt; &quot;Du bist leich pummelig geh ma joggen&quot;&lt;&lt;endl;
		}
		else if (alter [MAX] == 18||19||20||21||22||23||24 &amp;&amp; bmi &gt;29)
		{
			cout &lt;&lt; &quot;DU FETTSACK GEH MA ABNEHMEN&quot; &lt;&lt; endl;
		}
	else if (alter [MAX] == 25||26||27||28||29||30||31||32||33||34 &amp;&amp; bmi &lt;18 )
	{
		cout &lt;&lt; &quot;Sie sind Untergewichtig Sie sollten mal einbsichen mehr reinhauen&quot; &lt;&lt; endl;
	}

	 cout &lt;&lt; endl;

	cout &lt;&lt; setw(10) &lt;&lt; &quot;ALTER |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;Untergewicht |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;Normalgewicht |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;Leichtes Uebergewicht |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;Uebergewicht|&quot; &lt;&lt; endl;
	cout &lt;&lt; setw(10) &lt;&lt; &quot;------|&quot; &lt;&lt; setw (14) &lt;&lt; &quot;-------------|&quot; &lt;&lt; setw (15) &lt;&lt; &quot;--------------|&quot; &lt;&lt; setw(15) &lt;&lt; &quot;----------------------|&quot; &lt;&lt; setw(13) &lt;&lt; &quot;------------|&quot; &lt;&lt; endl;
	cout &lt;&lt; setw(10) &lt;&lt; &quot;  16  |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;     &lt;18     |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;     19-24    |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;         25-28        |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;     &gt;29    |&quot; &lt;&lt; endl;
	cout &lt;&lt; setw(10) &lt;&lt; &quot;  17  |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;     &lt;18     |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;     19-24    |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;         25-28        |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;     &gt;29    |&quot; &lt;&lt; endl;
	cout &lt;&lt; setw(10) &lt;&lt; &quot;  18  |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;     &lt;18     |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;     19-24    |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;         25-28        |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;     &gt;29    |&quot; &lt;&lt; endl;
	cout &lt;&lt; setw(10) &lt;&lt; &quot;19-24 |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;     &lt;18     |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;     19-24    |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;         25-28        |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;     &gt;29    |&quot; &lt;&lt; endl;
	cout &lt;&lt; setw(10) &lt;&lt; &quot;25-34 |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;     &lt;19     |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;     20-26    |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;         27-29        |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;     &gt;30    |&quot; &lt;&lt; endl;
	cout &lt;&lt; setw(10) &lt;&lt; &quot;35-44 |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;     &lt;20     |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;     21-26    |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;         27-30        |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;     &gt;31    |&quot; &lt;&lt; endl;
	cout &lt;&lt; setw(10) &lt;&lt; &quot;45-54 |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;     &lt;21     |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;     22-27    |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;         28-31        |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;     &gt;32    |&quot; &lt;&lt; endl;
	cout &lt;&lt; setw(10) &lt;&lt; &quot;55-64 |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;     &lt;22     |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;     23-28    |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;         29-32        |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;     &gt;33    |&quot; &lt;&lt; endl;
	cout &lt;&lt; setw(10) &lt;&lt; &quot;65-90 |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;     &lt;23     |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;     24-29    |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;         30-33        |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;     &gt;34    |&quot; &lt;&lt; endl;

	cin.get ();
	return 0;
}
</code></pre>
<p>Es klappt nicht so ganz bitte um hilfe</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/329811/c-bmi-rechner</link><generator>RSS for Node</generator><lastBuildDate>Fri, 03 Jul 2026 18:51:07 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/329811.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 08 Dec 2014 22:24:16 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to c++ BMI Rechner on Mon, 08 Dec 2014 22:24:16 GMT]]></title><description><![CDATA[<p>HALLO ich muss für die schule einen bmi rechner programmieren hab ich geschafft und läuft.</p>
<p>Doch ich wollte noch eine weiter Option hinzufügen, dass man seinn Alter noch eingeben muss.</p>
<pre><code>#include &lt;iostream&gt; 
#include &lt;windows.h&gt;
#include &lt;iomanip&gt;

using namespace std;
const int MAX = 80;

int main () 
{
	float gewicht, grosse, helf, bmiH, bmi ;
	char alter [MAX];

	cout &lt;&lt; &quot;Geben Sie ihre Groesse ein: &quot;;
	cin &gt;&gt; grosse;
	cout &lt;&lt; &quot;Ihre grosse betreagt: &quot; &lt;&lt; grosse ;

cout &lt;&lt; endl;

	cout &lt;&lt;&quot;Geben Sie ihr Gewicht ein: &quot; ;
	cin &gt;&gt; gewicht;

cout &lt;&lt; endl;

	cout &lt;&lt; &quot;Geben Sie ihr Alter ein: &quot;;
	cin.getline (alter, MAX);
	cin &gt;&gt; alter;

	helf = grosse * grosse;

	bmiH = gewicht/ helf ;
	bmi = bmiH * 10000;

	cout &lt;&lt; endl;

	cout &lt;&lt; &quot;Ihr Bmi liegt bei: &quot; &lt;&lt; bmi &lt;&lt; endl;

	cout &lt;&lt; endl;	

	if (alter [MAX] ==  '16' &amp;&amp; bmi &lt;= 18 )
		{
			cout &lt;&lt; &quot;Sie sind Untergewichtig Sie sollten mal einbsichen mehr reinhauen&quot; &lt;&lt; endl;
		}
		 else if (alter [MAX] == 16 &amp;&amp; bmi == 19||20||21||22||23||24 )
			{
				cout &lt;&lt; &quot;Sieh haben ein normales Gewicht weiter so&quot;&lt;&lt;endl;
			}
		 else if (alter [MAX] == 16 &amp;&amp; bmi == 25||26||27||28 )
		{
			cout &lt;&lt; &quot;Du bist leicht pummelig geh ma joggen&quot;&lt;&lt;endl;
			}	
			else if (alter [MAX] == 16 &amp;&amp; bmi &gt;29)
			{
				cout &lt;&lt; &quot;DU FETTSACK GEH MA ABNEHMEN&quot; &lt;&lt; endl;
				}	
	 else if (alter [MAX] == 17 &amp;&amp; bmi &lt;= 18)
	{
		cout &lt;&lt; &quot;Sie sind Untergewichtig Sie sollten mal einbsichen mehr reinhauen&quot;&lt;&lt;endl;
	}
	 else if (alter [MAX] == 17 &amp;&amp; bmi == 19||20||21||22||23||24)
	{
		cout &lt;&lt; &quot;Sieh haben ein normales Gewicht weiter so&quot;&lt;&lt;endl;
	}
	 else if (alter [MAX] == 17 &amp;&amp; bmi == 25||26||27||28)
	{
		cout &lt;&lt; &quot;Du bist leich pummelig geh ma joggen&quot;&lt;&lt;endl;
	}
		else if (alter [MAX] == 18||19||20||21||22||23||24 &amp;&amp; bmi &lt;= 18)
		{
			cout &lt;&lt; &quot;Sie sind Untergewichtig Sie sollten mal einbsichen mehr reinhauen &quot; &lt;&lt; endl;
		}
		else if (alter [MAX] == 18||19||20||21||22||23||24 &amp;&amp; bmi == 19||20||21||22||23||24)
		{
			cout &lt;&lt; &quot;Sieh haben ein normales Gewicht weiter so&quot; &lt;&lt; endl;
		}	
		else if (alter [MAX] == 18||19||20||21||22||23||24 &amp;&amp; bmi == 25||26||27||28)
		{
			cout &lt;&lt; &quot;Du bist leich pummelig geh ma joggen&quot;&lt;&lt;endl;
		}
		else if (alter [MAX] == 18||19||20||21||22||23||24 &amp;&amp; bmi &gt;29)
		{
			cout &lt;&lt; &quot;DU FETTSACK GEH MA ABNEHMEN&quot; &lt;&lt; endl;
		}
	else if (alter [MAX] == 25||26||27||28||29||30||31||32||33||34 &amp;&amp; bmi &lt;18 )
	{
		cout &lt;&lt; &quot;Sie sind Untergewichtig Sie sollten mal einbsichen mehr reinhauen&quot; &lt;&lt; endl;
	}

	 cout &lt;&lt; endl;

	cout &lt;&lt; setw(10) &lt;&lt; &quot;ALTER |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;Untergewicht |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;Normalgewicht |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;Leichtes Uebergewicht |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;Uebergewicht|&quot; &lt;&lt; endl;
	cout &lt;&lt; setw(10) &lt;&lt; &quot;------|&quot; &lt;&lt; setw (14) &lt;&lt; &quot;-------------|&quot; &lt;&lt; setw (15) &lt;&lt; &quot;--------------|&quot; &lt;&lt; setw(15) &lt;&lt; &quot;----------------------|&quot; &lt;&lt; setw(13) &lt;&lt; &quot;------------|&quot; &lt;&lt; endl;
	cout &lt;&lt; setw(10) &lt;&lt; &quot;  16  |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;     &lt;18     |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;     19-24    |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;         25-28        |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;     &gt;29    |&quot; &lt;&lt; endl;
	cout &lt;&lt; setw(10) &lt;&lt; &quot;  17  |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;     &lt;18     |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;     19-24    |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;         25-28        |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;     &gt;29    |&quot; &lt;&lt; endl;
	cout &lt;&lt; setw(10) &lt;&lt; &quot;  18  |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;     &lt;18     |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;     19-24    |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;         25-28        |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;     &gt;29    |&quot; &lt;&lt; endl;
	cout &lt;&lt; setw(10) &lt;&lt; &quot;19-24 |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;     &lt;18     |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;     19-24    |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;         25-28        |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;     &gt;29    |&quot; &lt;&lt; endl;
	cout &lt;&lt; setw(10) &lt;&lt; &quot;25-34 |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;     &lt;19     |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;     20-26    |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;         27-29        |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;     &gt;30    |&quot; &lt;&lt; endl;
	cout &lt;&lt; setw(10) &lt;&lt; &quot;35-44 |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;     &lt;20     |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;     21-26    |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;         27-30        |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;     &gt;31    |&quot; &lt;&lt; endl;
	cout &lt;&lt; setw(10) &lt;&lt; &quot;45-54 |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;     &lt;21     |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;     22-27    |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;         28-31        |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;     &gt;32    |&quot; &lt;&lt; endl;
	cout &lt;&lt; setw(10) &lt;&lt; &quot;55-64 |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;     &lt;22     |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;     23-28    |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;         29-32        |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;     &gt;33    |&quot; &lt;&lt; endl;
	cout &lt;&lt; setw(10) &lt;&lt; &quot;65-90 |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;     &lt;23     |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;     24-29    |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;         30-33        |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;     &gt;34    |&quot; &lt;&lt; endl;

	cin.get ();
	return 0;
}
</code></pre>
<p>Es klappt nicht so ganz bitte um hilfe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2431892</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2431892</guid><dc:creator><![CDATA[Sgaf]]></dc:creator><pubDate>Mon, 08 Dec 2014 22:24:16 GMT</pubDate></item><item><title><![CDATA[Reply to c++ BMI Rechner on Mon, 08 Dec 2014 22:41:56 GMT]]></title><description><![CDATA[<p>Sgaf schrieb:</p>
<blockquote>
<p>Es klappt nicht so ganz</p>
</blockquote>
<p>Dann ist ja alles glasklar, der Fehler sollte offensichtlich sein.</p>
<p>PS: Ich bin mal nicht ganz so fies, obwohl du es bei solch einer Frage eigentlich verdient hättest und liefere zumindest die Compilerwarnungen, die du anscheinend nicht anschalten konntest. Alle weisen sie auf dicke Fehler hin:</p>
<pre><code>test.cc:42:25: warning: multi-character character constant [-Wmultichar]
     if (alter [MAX] ==  '16' &amp;&amp; bmi &lt;= 18 )
                         ^
test.cc: In function ‘int main()’:
test.cc:42:25: warning: comparison is always false due to limited range of data type [-Wtype-limits]
test.cc:46:37: warning: suggest parentheses around ‘&amp;&amp;’ within ‘||’ [-Wparentheses]
          else if (alter [MAX] == 16 &amp;&amp; bmi == 19||20||21||22||23||24 )
                                     ^
test.cc:50:37: warning: suggest parentheses around ‘&amp;&amp;’ within ‘||’ [-Wparentheses]
          else if (alter [MAX] == 16 &amp;&amp; bmi == 25||26||27||28 )
                                     ^
test.cc:62:33: warning: suggest parentheses around ‘&amp;&amp;’ within ‘||’ [-Wparentheses]
      else if (alter [MAX] == 17 &amp;&amp; bmi == 19||20||21||22||23||24)
                                 ^
test.cc:66:33: warning: suggest parentheses around ‘&amp;&amp;’ within ‘||’ [-Wparentheses]
      else if (alter [MAX] == 17 &amp;&amp; bmi == 25||26||27||28)
                                 ^
test.cc:70:60: warning: suggest parentheses around ‘&amp;&amp;’ within ‘||’ [-Wparentheses]
         else if (alter [MAX] == 18||19||20||21||22||23||24 &amp;&amp; bmi &lt;= 18)
                                                            ^
test.cc:74:60: warning: suggest parentheses around ‘&amp;&amp;’ within ‘||’ [-Wparentheses]
         else if (alter [MAX] == 18||19||20||21||22||23||24 &amp;&amp; bmi == 19||20||21||22||23||24)
                                                            ^
test.cc:78:60: warning: suggest parentheses around ‘&amp;&amp;’ within ‘||’ [-Wparentheses]
         else if (alter [MAX] == 18||19||20||21||22||23||24 &amp;&amp; bmi == 25||26||27||28)
                                                            ^
test.cc:82:60: warning: suggest parentheses around ‘&amp;&amp;’ within ‘||’ [-Wparentheses]
         else if (alter [MAX] == 18||19||20||21||22||23||24 &amp;&amp; bmi &gt;29)
                                                            ^
test.cc:86:68: warning: suggest parentheses around ‘&amp;&amp;’ within ‘||’ [-Wparentheses]
     else if (alter [MAX] == 25||26||27||28||29||30||31||32||33||34 &amp;&amp; bmi &lt;18 )
                                                                    ^
</code></pre>
<p>Die ganzen Warnungen, wo Klammern vorgeschlagen werden, weisen gleich auf einen dreifachen Fehler hin:<br />
<code>a == b || c</code> ist nicht das gleiche wie <code>a == b || a == c</code> , sondern <code>a == (b || c)</code> . Du vergleichst also deinen bmi-Wert mit der VerODERung von einer ganzen Reihe von Zahlen.<br />
Was ist, wenn dein bmi-Wert keine Ganzzahl ist?<br />
Und zu guter Letzt das, was die Warnung aussagt: UND bindet stärker als ODER.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2431894</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2431894</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Mon, 08 Dec 2014 22:41:56 GMT</pubDate></item><item><title><![CDATA[Reply to c++ BMI Rechner on Mon, 08 Dec 2014 22:38:34 GMT]]></title><description><![CDATA[<p>Warum ost alter ein char Array und kein int?<br />
Sämtliche Tests mit alter sind blödsinn und wären mit int einfacher.<br />
Vergleich können nicht abgekürzt werden. Es muss heissen<br />
alter == 1 || alter == 2</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2431896</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2431896</guid><dc:creator><![CDATA[manni66]]></dc:creator><pubDate>Mon, 08 Dec 2014 22:38:34 GMT</pubDate></item><item><title><![CDATA[Reply to c++ BMI Rechner on Tue, 09 Dec 2014 15:40:02 GMT]]></title><description><![CDATA[<p>wenn ich das als int schreibe das array kommt mir ein fehler</p>
<p>also musste ich bei meiner veroderung beim alter das immer einzeln hinschreiben?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2431977</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2431977</guid><dc:creator><![CDATA[Sgaf]]></dc:creator><pubDate>Tue, 09 Dec 2014 15:40:02 GMT</pubDate></item><item><title><![CDATA[Reply to c++ BMI Rechner on Tue, 09 Dec 2014 15:36:36 GMT]]></title><description><![CDATA[<p>Lorem ipsum</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2431978</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2431978</guid><dc:creator><![CDATA[Troll detected]]></dc:creator><pubDate>Tue, 09 Dec 2014 15:36:36 GMT</pubDate></item><item><title><![CDATA[Reply to c++ BMI Rechner on Tue, 09 Dec 2014 15:39:53 GMT]]></title><description><![CDATA[<p>Nur einer?</p>
<p>Ok raten.<br />
Müssen wir die Zeilennummer dazu sagen, ist die Fehlermeldung in deutsch oder englisch?</p>
<p>Mmm....</p>
<p>Ich nehme ertmal ein N</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2431979</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2431979</guid><dc:creator><![CDATA[DirkB]]></dc:creator><pubDate>Tue, 09 Dec 2014 15:39:53 GMT</pubDate></item><item><title><![CDATA[Reply to c++ BMI Rechner on Tue, 09 Dec 2014 16:03:57 GMT]]></title><description><![CDATA[<p>Sgaf schrieb:</p>
<blockquote>
<p>wenn ich das als int schreibe das array kommt mir ein fehler</p>
</blockquote>
<p>Wenn Du Dich an Deinen Thread (<a href="https://www.c-plusplus.net/forum/329794">https://www.c-plusplus.net/forum/329794</a>) von gestern erinnerst, hattest Du dort eine Methode um longs von der Tastatur einzulesen.<br />
Ein nicht so schwerer Algorithmus, der etwas Wissen um ASCII verlangt, aber ansonsten nur unserem Dezimalsystem entspricht.</p>
<p>Ungefähr so sah das aus, und Du wolltest noch ein wenig darüber grübeln:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;

long get_num(){
  const int MAX = 32;
  char input [MAX];
  int i = 0;
  long Wert = 0;

  std::cin.getline(input, MAX);
  while (input[i] &gt;='0' &amp;&amp; input[i] &lt;='9')
    {
      Wert *= 10;
      Wert += input[i] - '0';
    i++;
    }
  return Wert;
}

int main(){
  long l = get_num();
  std::cout &lt;&lt; &quot;l:  &quot; &lt;&lt; l &lt;&lt; std::endl;
}
</code></pre>
<p>Ein typisches doofes Buchbeispiel, oder eine Aufgabe für ein Praktikum. Hat Dich auf jeden Fall erfolgreich verwirrt...</p>
<p>Im echten Leben geht Zahleneinlesen so:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;

int main(){
  int i;
  std::cin &gt;&gt; i;
  std::cout &lt;&lt; &quot;i: &quot; &lt;&lt; i &lt;&lt; std::endl;
}
</code></pre>
<p>Genauso machst Du das mit <code>alter</code> jetzt auch. (Wie Du es schon mit <code>groesse</code> und <code>gewicht</code> tust.)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2431982</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2431982</guid><dc:creator><![CDATA[Furble Wurble]]></dc:creator><pubDate>Tue, 09 Dec 2014 16:03:57 GMT</pubDate></item><item><title><![CDATA[Reply to c++ BMI Rechner on Tue, 09 Dec 2014 16:36:22 GMT]]></title><description><![CDATA[<p>danke <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/2431990</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2431990</guid><dc:creator><![CDATA[Sgaf]]></dc:creator><pubDate>Tue, 09 Dec 2014 16:36:22 GMT</pubDate></item><item><title><![CDATA[Reply to c++ BMI Rechner on Wed, 10 Dec 2014 13:55:00 GMT]]></title><description><![CDATA[<pre><code>#include &lt;iostream&gt;
#include &lt;windows.h&gt;
#include &lt;iomanip&gt;

using namespace std;
const int MAX = 80;

int main ()
{
    float gewicht, grosse, helf, bmiH, bmi ;
    int alter ;

    cout &lt;&lt; &quot;Geben Sie ihre Groesse ein: &quot;;
    cin &gt;&gt; grosse;
    cout &lt;&lt; &quot;Ihre grosse betreagt: &quot; &lt;&lt; grosse &lt;&lt; &quot;cm&quot;;

cout &lt;&lt; endl;
cout &lt;&lt; endl;

    cout &lt;&lt;&quot;Geben Sie ihr Gewicht ein: &quot; ;
    cin &gt;&gt; gewicht;
    cout &lt;&lt; &quot;Ihr Gewicht betreagt: &quot; &lt;&lt; gewicht &lt;&lt; &quot;kg&quot;;

cout &lt;&lt; endl;
cout &lt;&lt; endl;

    cout &lt;&lt; &quot;Geben Sie ihr Alter ein: &quot;;
    cin &gt;&gt; alter;

    helf = grosse * grosse;

    bmiH = gewicht/ helf ;
    bmi = bmiH * 10000;

    cout &lt;&lt; endl;

    cout &lt;&lt; &quot;Ihr Bmi liegt bei: &quot; &lt;&lt; bmi &lt;&lt; endl;

    cout &lt;&lt; endl;  
    cout &lt;&lt; endl;

    if (alter ==  16 &amp;&amp; bmi &lt;= 18 )
        {
            cout &lt;&lt; &quot;Sie sind untergewichtig Sie sollten mal ein bisschen mehr reinhauen&quot; &lt;&lt; endl;
        }
         else if (alter  == 16 &amp;&amp; bmi == 19||bmi == 20||bmi == 21|| bmi == 22||bmi == 23||bmi == 24 )
            {
                cout &lt;&lt; &quot;Sie haben ein normales Gewicht weiter so&quot;&lt;&lt;endl;
            }
         else if (alter  == 16 &amp;&amp; bmi == 25||bmi == 26||bmi == 27||bmi == 28 )
        {
            cout &lt;&lt; &quot;Du bist leicht pummelig geh mal joggen&quot;&lt;&lt;endl;
            }  
            else if (alter  == 16 &amp;&amp; bmi &gt;29)
            {
                cout &lt;&lt; &quot;DU FETTSACK GEH MAL ABNEHMEN&quot; &lt;&lt; endl;
                }  
     else if (alter  == 17 &amp;&amp; bmi &lt;= 18)
    {
        cout &lt;&lt; &quot;Sie sind untergewichtig Sie sollten mal ein bisschen mehr reinhauen&quot;&lt;&lt;endl;
    }
     else if (alter  == 17 &amp;&amp; bmi == 19||bmi == 20|| bmi == 21||bmi == 22||bmi == 23||bmi == 24)
    {
        cout &lt;&lt; &quot;Sie haben ein normales Gewicht weiter so&quot;&lt;&lt;endl;
    }
     else if (alter  == 17 &amp;&amp; bmi == 25||bmi == 26||bmi == 27||bmi == 28)
    {
        cout &lt;&lt; &quot;Du bist leicht pummelig geh mal joggen&quot;&lt;&lt;endl;
    }
    else if (alter == 17 &amp;&amp; bmi &gt;= 29  )
    {
    	cout &lt;&lt; &quot;DU FETTSACK GEH MAL ABNHEMEN&quot; &lt;&lt; endl;
	}
        else if (alter  == 18 &amp;&amp; bmi &lt;= 18)
        {
            cout &lt;&lt; &quot;Sie sind untergewichtig Sie sollten mal ein bisschen mehr reinhauen &quot; &lt;&lt; endl;
        }
        else if (alter 1== 18 &amp;&amp; bmi == 19||bmi == 20||bmi == 21||bmi == 22||bmi == 23||bmi == 24)
        {
            cout &lt;&lt; &quot;Sie haben ein normales Gewicht weiter so&quot; &lt;&lt; endl;
        }  
        else if (alter  == 18 &amp;&amp; bmi == 25||bmi == 26||bmi == 27||bmi == 28)
        {
            cout &lt;&lt; &quot;Du bist leicht pummelig geh mal joggen&quot;&lt;&lt;endl;
        }
        else if (alter  == 18  &amp;&amp; bmi &gt;29)
        {
            cout &lt;&lt; &quot;DU FETTSACK GEH MAL ABNEHMEN&quot; &lt;&lt; endl;
        }
	cout &lt;&lt; &quot;DU FETTSACK GEH MAL ABNEHMN&quot; &lt;&lt; endl;
	 }

     cout &lt;&lt; endl;
   	 cout &lt;&lt; endl;

    cout &lt;&lt; setw(10) &lt;&lt; &quot;ALTER |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;Untergewicht |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;Normalgewicht |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;Leichtes Uebergewicht |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;Uebergewicht|&quot; &lt;&lt; endl;
    cout &lt;&lt; setw(10) &lt;&lt; &quot;------|&quot; &lt;&lt; setw (14) &lt;&lt; &quot;-------------|&quot; &lt;&lt; setw (15) &lt;&lt; &quot;--------------|&quot; &lt;&lt; setw(15) &lt;&lt; &quot;----------------------|&quot; &lt;&lt; setw(13) &lt;&lt; &quot;------------|&quot; &lt;&lt; endl;
    cout &lt;&lt; setw(10) &lt;&lt; &quot;  16  |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;     &lt;18     |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;     19-24    |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;         25-28        |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;     &gt;29    |&quot; &lt;&lt; endl;
    cout &lt;&lt; setw(10) &lt;&lt; &quot;  17  |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;     &lt;18     |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;     19-24    |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;         25-28        |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;     &gt;29    |&quot; &lt;&lt; endl;
    cout &lt;&lt; setw(10) &lt;&lt; &quot;  18  |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;     &lt;18     |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;     19-24    |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;         25-28        |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;     &gt;29    |&quot; &lt;&lt; endl;
    cout &lt;&lt; setw(10) &lt;&lt; &quot;19-24 |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;     &lt;18     |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;     19-24    |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;         25-28        |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;     &gt;29    |&quot; &lt;&lt; endl;
    cout &lt;&lt; setw(10) &lt;&lt; &quot;25-34 |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;     &lt;19     |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;     20-26    |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;         27-29        |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;     &gt;30    |&quot; &lt;&lt; endl;
    cout &lt;&lt; setw(10) &lt;&lt; &quot;35-44 |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;     &lt;20     |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;     21-26    |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;         27-30        |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;     &gt;31    |&quot; &lt;&lt; endl;
    cout &lt;&lt; setw(10) &lt;&lt; &quot;45-54 |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;     &lt;21     |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;     22-27    |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;         28-31        |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;     &gt;32    |&quot; &lt;&lt; endl;
    cout &lt;&lt; setw(10) &lt;&lt; &quot;55-64 |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;     &lt;22     |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;     23-28    |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;         29-32        |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;     &gt;33    |&quot; &lt;&lt; endl;
    cout &lt;&lt; setw(10) &lt;&lt; &quot;65-90 |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;     &lt;23     |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;     24-29    |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;         30-33        |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;     &gt;34    |&quot; &lt;&lt; endl;

    cin.get ();
    return 0;
}
</code></pre>
<p>Es mag mir nichts mehr ausgeben warum?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2432147</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2432147</guid><dc:creator><![CDATA[Sgaf]]></dc:creator><pubDate>Wed, 10 Dec 2014 13:55:00 GMT</pubDate></item><item><title><![CDATA[Reply to c++ BMI Rechner on Wed, 10 Dec 2014 20:40:29 GMT]]></title><description><![CDATA[<p>Lies den Thread! Aufmerksam! Da sind immer noch Fehler drin, die erwähnt wurden, aber noch nicht behoben wurden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2432227</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2432227</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Wed, 10 Dec 2014 20:40:29 GMT</pubDate></item><item><title><![CDATA[Reply to c++ BMI Rechner on Thu, 11 Dec 2014 09:29:02 GMT]]></title><description><![CDATA[<p>Ok ich hab die ganzen fehler rausgefunden riuchtige dummheitsfehler aber trotzdem danke an alle</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2432307</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2432307</guid><dc:creator><![CDATA[Sgaf]]></dc:creator><pubDate>Thu, 11 Dec 2014 09:29:02 GMT</pubDate></item><item><title><![CDATA[Reply to c++ BMI Rechner on Thu, 11 Dec 2014 09:58:10 GMT]]></title><description><![CDATA[<pre><code>#include &lt;iostream&gt;
#include &lt;windows.h&gt;
#include &lt;iomanip&gt;

using namespace std;

int main ()
{
    float gewicht, grosse, helf, bmiH, bmi ;
    int alter ;

    cout &lt;&lt; &quot;Geben Sie ihre Groesse ein: &quot;;
    cin &gt;&gt; grosse;
    cout &lt;&lt; &quot;Ihre grosse betreagt: &quot; &lt;&lt; grosse &lt;&lt; &quot;cm&quot;;

cout &lt;&lt; endl;
cout &lt;&lt; endl;

    cout &lt;&lt;&quot;Geben Sie ihr Gewicht ein: &quot; ;
    cin &gt;&gt; gewicht;
    cout &lt;&lt; &quot;Ihr Gewicht betreagt: &quot; &lt;&lt; gewicht &lt;&lt; &quot;kg&quot;;

cout &lt;&lt; endl;
cout &lt;&lt; endl;

    cout &lt;&lt; &quot;Geben Sie ihr Alter ein: &quot;;
    cin &gt;&gt; alter;

    helf = grosse * grosse;

    bmiH = gewicht / helf ;
    bmi = bmiH * 10000;

    cout &lt;&lt; endl;

    cout &lt;&lt; &quot;Ihr Bmi liegt bei: &quot; &lt;&lt; bmi &lt;&lt; endl;

cout &lt;&lt; endl;
cout &lt;&lt; endl;

    if (alter ==  16 &amp;&amp; bmi &lt;= 18 )
        {
            cout &lt;&lt; &quot;Sie sind untergewichtig Sie sollten mal ein bisschen mehr reinhauen&quot; &lt;&lt; endl;
        }
         else if (alter  == 16 &amp;&amp; bmi &lt;= 19||bmi &lt;= 20||bmi &lt;= 21|| bmi &lt;= 22||bmi &lt;= 23||bmi &lt;= 24 )
            {
                cout &lt;&lt; &quot;Sie haben ein normales Gewicht weiter so&quot;&lt;&lt;endl;
            }
         else if (alter  == 16 &amp;&amp; bmi &lt;= 25||bmi &lt;= 26||bmi &lt;= 27||bmi &lt;= 28 )
        {
            cout &lt;&lt; &quot;Du bist leicht pummelig geh mal joggen&quot;&lt;&lt;endl;
            }
            else if (alter  == 16 &amp;&amp; bmi &gt;29)
            {
                cout &lt;&lt; &quot;DU FETTSACK GEH MAL ABNEHMEN&quot; &lt;&lt; endl;
                }
     else if (alter  == 17 &amp;&amp; bmi &lt;= 18)
    {
        cout &lt;&lt; &quot;Sie sind untergewichtig Sie sollten mal ein bisschen mehr reinhauen&quot;&lt;&lt;endl;
    }
     else if (alter  == 17 &amp;&amp; bmi &lt;= 19||bmi &lt;= 20|| bmi &lt;= 21||bmi &lt;= 22||bmi &lt;= 23||bmi &lt;= 24)
    {
        cout &lt;&lt; &quot;Sie haben ein normales Gewicht weiter so&quot;&lt;&lt;endl;
    }
     else if (alter  == 17 &amp;&amp; bmi &lt;= 25||bmi &lt;= 26||bmi &lt;= 27||bmi &lt;= 28)
    {
        cout &lt;&lt; &quot;Du bist leicht pummelig geh mal joggen&quot;&lt;&lt;endl;
    }
    else if (alter == 17 &amp;&amp; bmi &gt;= 29  )
    {
        cout &lt;&lt; &quot;DU FETTSACK GEH MAL ABNHEMEN&quot; &lt;&lt; endl;
    }
        else if (alter  == 18 &amp;&amp; bmi &lt;= 18)
        {
            cout &lt;&lt; &quot;Sie sind untergewichtig Sie sollten mal ein bisschen mehr reinhauen &quot; &lt;&lt; endl;
        }
        else if (alter == 18 &amp;&amp; bmi &lt;= 19||bmi &lt;= 20||bmi &lt;= 21||bmi &lt;= 22||bmi &lt;= 23||bmi &lt;= 24)
        {
            cout &lt;&lt; &quot;Sie haben ein normales Gewicht weiter so&quot; &lt;&lt; endl;
        }
        else if (alter  == 18 &amp;&amp; bmi == 25||bmi == 26||bmi == 27||bmi == 28)
        {
            cout &lt;&lt; &quot;Du bist leicht pummelig geh mal joggen&quot;&lt;&lt;endl;
        }
        else if (alter  == 18  &amp;&amp; bmi &gt;29)
        {
            cout &lt;&lt; &quot;DU FETTSACK GEH MAL ABNEHMEN&quot; &lt;&lt; endl;
        }

     cout &lt;&lt; endl;
     cout &lt;&lt; endl;

    cout &lt;&lt; setw(10) &lt;&lt; &quot;ALTER |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;Untergewicht |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;Normalgewicht |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;Leichtes Uebergewicht |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;Uebergewicht|&quot; &lt;&lt; endl;
    cout &lt;&lt; setw(10) &lt;&lt; &quot;------|&quot; &lt;&lt; setw (14) &lt;&lt; &quot;-------------|&quot; &lt;&lt; setw (15) &lt;&lt; &quot;--------------|&quot; &lt;&lt; setw(15) &lt;&lt; &quot;----------------------|&quot; &lt;&lt; setw(13) &lt;&lt; &quot;------------|&quot; &lt;&lt; endl;
    cout &lt;&lt; setw(10) &lt;&lt; &quot;  16  |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;     &lt;18     |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;     19-24    |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;         25-28        |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;     &gt;29    |&quot; &lt;&lt; endl;
    cout &lt;&lt; setw(10) &lt;&lt; &quot;  17  |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;     &lt;18     |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;     19-24    |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;         25-28        |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;     &gt;29    |&quot; &lt;&lt; endl;
    cout &lt;&lt; setw(10) &lt;&lt; &quot;  18  |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;     &lt;18     |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;     19-24    |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;         25-28        |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;     &gt;29    |&quot; &lt;&lt; endl;
    cout &lt;&lt; setw(10) &lt;&lt; &quot;19-24 |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;     &lt;18     |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;     19-24    |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;         25-28        |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;     &gt;29    |&quot; &lt;&lt; endl;
    cout &lt;&lt; setw(10) &lt;&lt; &quot;25-34 |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;     &lt;19     |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;     20-26    |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;         27-29        |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;     &gt;30    |&quot; &lt;&lt; endl;
    cout &lt;&lt; setw(10) &lt;&lt; &quot;35-44 |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;     &lt;20     |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;     21-26    |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;         27-30        |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;     &gt;31    |&quot; &lt;&lt; endl;
    cout &lt;&lt; setw(10) &lt;&lt; &quot;45-54 |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;     &lt;21     |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;     22-27    |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;         28-31        |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;     &gt;32    |&quot; &lt;&lt; endl;
    cout &lt;&lt; setw(10) &lt;&lt; &quot;55-64 |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;     &lt;22     |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;     23-28    |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;         29-32        |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;     &gt;33    |&quot; &lt;&lt; endl;
    cout &lt;&lt; setw(10) &lt;&lt; &quot;65-90 |&quot; &lt;&lt; setw (14) &lt;&lt; &quot;     &lt;23     |&quot; &lt;&lt; setw (15) &lt;&lt; &quot;     24-29    |&quot; &lt;&lt; setw(15) &lt;&lt; &quot;         30-33        |&quot; &lt;&lt; setw(13) &lt;&lt; &quot;     &gt;34    |&quot; &lt;&lt; endl;

    cin.get ();
    return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2432312</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2432312</guid><dc:creator><![CDATA[Sgaf]]></dc:creator><pubDate>Thu, 11 Dec 2014 09:58:10 GMT</pubDate></item><item><title><![CDATA[Reply to c++ BMI Rechner on Thu, 11 Dec 2014 17:44:41 GMT]]></title><description><![CDATA[<blockquote>
<pre><code>if (alter  == 16 &amp;&amp; bmi &lt;= 25||bmi &lt;= 26||bmi &lt;= 27||bmi &lt;= 28)
</code></pre>
</blockquote>
<p>Denkst du auch nach über das was du schreibst oder ist das eher Codeerzeugung am Fließband?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2432364</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2432364</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Thu, 11 Dec 2014 17:44:41 GMT</pubDate></item><item><title><![CDATA[Reply to c++ BMI Rechner on Fri, 12 Dec 2014 18:33:52 GMT]]></title><description><![CDATA[<p>SeppJ schrieb:</p>
<blockquote>
<blockquote>
<pre><code>if (alter  == 16 &amp;&amp; bmi &lt;= 25||bmi &lt;= 26||bmi &lt;= 27||bmi &lt;= 28)
</code></pre>
</blockquote>
<p>Denkst du auch nach über das was du schreibst oder ist das eher Codeerzeugung am Fließband?</p>
</blockquote>
<p>lel zum kaputtlachen <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/2432548</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2432548</guid><dc:creator><![CDATA[hardware]]></dc:creator><pubDate>Fri, 12 Dec 2014 18:33:52 GMT</pubDate></item><item><title><![CDATA[Reply to c++ BMI Rechner on Mon, 15 Dec 2014 09:55:33 GMT]]></title><description><![CDATA[<p>was ist denn daran so witzig?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2432916</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2432916</guid><dc:creator><![CDATA[Sgaf]]></dc:creator><pubDate>Mon, 15 Dec 2014 09:55:33 GMT</pubDate></item><item><title><![CDATA[Reply to c++ BMI Rechner on Mon, 15 Dec 2014 11:05:57 GMT]]></title><description><![CDATA[<pre><code>bmi &lt;= 25||bmi &lt;= 26||bmi &lt;= 27||bmi &lt;= 28
</code></pre>
<p>Ist komplett identisch zu</p>
<pre><code>bmi &lt;= 28
</code></pre>
<p>Und der Compiler wird es höchstwahrscheinlich auch wegoptimieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2432932</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2432932</guid><dc:creator><![CDATA[Columbo]]></dc:creator><pubDate>Mon, 15 Dec 2014 11:05:57 GMT</pubDate></item><item><title><![CDATA[Reply to c++ BMI Rechner on Mon, 15 Dec 2014 11:14:18 GMT]]></title><description><![CDATA[<p>Stimmt -.-</p>
<p>Ja daruber kann man lachen. xD</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2432933</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2432933</guid><dc:creator><![CDATA[Sgaf]]></dc:creator><pubDate>Mon, 15 Dec 2014 11:14:18 GMT</pubDate></item><item><title><![CDATA[Reply to c++ BMI Rechner on Mon, 15 Dec 2014 11:28:38 GMT]]></title><description><![CDATA[<p>Sgaf schrieb:</p>
<blockquote>
<pre><code>if (alter  == 16 &amp;&amp; bmi &lt;= 25||bmi &lt;= 26||bmi &lt;= 27||bmi &lt;= 28)
</code></pre>
</blockquote>
<p>Hm mal sehen. Nehmen wir an, das Alter ist 17 und bmi 25. Dann ergibt die Bedingung true. Obwohl doch direkt am Anfang auf &quot;alter == 16&quot; geprüft wird.</p>
<p>Lässt man übrigens die überflüssigen Bedingungen weg, also</p>
<pre><code>if (alter  == 16 &amp;&amp; bmi &lt;= 25)
</code></pre>
<p>dann ergibt das plötzlich false.</p>
<p>Denk mal drüber nach.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2432935</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2432935</guid><dc:creator><![CDATA[tntnet]]></dc:creator><pubDate>Mon, 15 Dec 2014 11:28:38 GMT</pubDate></item><item><title><![CDATA[Reply to c++ BMI Rechner on Mon, 15 Dec 2014 12:47:49 GMT]]></title><description><![CDATA[<p>Ups, habe gar nicht hingeschaut dass dort ja noch ein <code>&amp;&amp;</code> versteckt ist.</p>
<p>Dann gilt dasselbe eben für <code>bmi &lt;= 26||bmi &lt;= 27||bmi &lt;= 28</code> .</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2432956</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2432956</guid><dc:creator><![CDATA[Columbo]]></dc:creator><pubDate>Mon, 15 Dec 2014 12:47:49 GMT</pubDate></item></channel></rss>