<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Jetzt lerne ich Programmieren!</title>
	<atom:link href="http://www.jlip.de/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jlip.de</link>
	<description>oder so ähnlich</description>
	<lastBuildDate>Thu, 22 Apr 2010 14:58:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Struktogramme</title>
		<link>http://www.jlip.de/grundlagen/struktogramme/</link>
		<comments>http://www.jlip.de/grundlagen/struktogramme/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 13:03:39 +0000</pubDate>
		<dc:creator>Harun (admin)</dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[Grundlagen]]></category>
		<category><![CDATA[struktogramme]]></category>

		<guid isPermaLink="false">http://www.jlip.de/?p=241</guid>
		<description><![CDATA[Struktogramme
Man benötigt Struktogramme, um Programmabläufe Grafisch darzustellen. Es kommen keine Syntaxe rein. Sie müssen Allgemein formuliert sein sodass es von jedem verstanden werden kann.
Es wird zur Dokumentation, Programmentwurd bei komplizierten Programmen verwendet.

]]></description>
			<content:encoded><![CDATA[<p><span style="text-decoration: underline;"><strong>Struktogramme</strong></span></p>
<p>Man benötigt Struktogramme, um Programmabläufe Grafisch darzustellen. Es kommen keine Syntaxe rein. Sie müssen Allgemein formuliert sein sodass es von jedem verstanden werden kann.<span id="more-241"></span></p>
<p>Es wird zur Dokumentation, Programmentwurd bei komplizierten Programmen verwendet.</p>
<p style="text-align: center;"><a href="http://www.jlip.de/wp-content/uploads/stg.jpg"><img class="aligncenter size-full wp-image-242" title="stg" src="http://www.jlip.de/wp-content/stg.jpg" alt="stg" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jlip.de/grundlagen/struktogramme/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Kontrollstrukturen if &#8211; else in C</title>
		<link>http://www.jlip.de/c/kontrollstrukturen-if-else-in-c/</link>
		<comments>http://www.jlip.de/c/kontrollstrukturen-if-else-in-c/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 12:40:49 +0000</pubDate>
		<dc:creator>Harun (admin)</dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[else]]></category>
		<category><![CDATA[if]]></category>
		<category><![CDATA[if else]]></category>
		<category><![CDATA[kontrollstrukturen]]></category>

		<guid isPermaLink="false">http://www.jlip.de/?p=234</guid>
		<description><![CDATA[if - else
Mit if erstellt man eine Bedingung auf, die erfüllt werden muss, bevor die Anweiung ausgeführt wird. Wenn die Bedingung nicht erfüllt wird kann else folgen oder es wird einfach alles ignoriert.


Syntax

&#160;
if&#40;Bedingung&#41; // danach nie ein Semikolon ;
&#123;
// Anweisung die ausgeführt wird
// Wenn die Bedingung erfüllt ist
&#125;
else // nur optional
&#123;
// Anweisung wenn die Bed. [...]]]></description>
			<content:encoded><![CDATA[<h2>if - else</h2>
<p>Mit if erstellt man eine Bedingung auf, die erfüllt werden muss, bevor die Anweiung ausgeführt wird. Wenn die Bedingung nicht erfüllt wird kann else folgen oder es wird einfach alles ignoriert.</p>
<p><span id="more-234"></span></p>
<ul>
<li><strong><span style="text-decoration: underline;">Syntax</span></strong></li>
</ul>
<pre class="cpp">&nbsp;
<span style="color: #0000ff;">if</span><span style="color: #000000;">&#40;</span>Bedingung<span style="color: #000000;">&#41;</span> <span style="color: #ff0000;">// danach nie ein Semikolon ;</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #ff0000;">// Anweisung die ausgeführt wird</span>
<span style="color: #ff0000;">// Wenn die Bedingung erfüllt ist</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #0000ff;">else</span> <span style="color: #ff0000;">// nur optional</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #ff0000;">// Anweisung wenn die Bed. nicht erfüllt ist</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
BSP:
&nbsp;
<span style="color: #0000ff;">int</span> i;
&nbsp;
  <span style="color: #0000dd;">scanf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;%i&quot;</span>, &amp;amp;i<span style="color: #000000;">&#41;</span>;
  <span style="color: #0000ff;">if</span><span style="color: #000000;">&#40;</span>i &amp;gt; <span style="color: #0000dd;">10</span><span style="color: #000000;">&#41;</span>
  <span style="color: #000000;">&#123;</span>
   <span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;i ist größer als 10&quot;</span><span style="color: #000000;">&#41;</span>;
  <span style="color: #000000;">&#125;</span>
  <span style="color: #0000ff;">else</span>
  <span style="color: #000000;">&#123;</span>
  <span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;i ist kleiner als 10&quot;</span><span style="color: #000000;">&#41;</span>;
  <span style="color: #000000;">&#125;</span></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.jlip.de/c/kontrollstrukturen-if-else-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Inkrement und Dekrement</title>
		<link>http://www.jlip.de/c/inkrement-und-dekrement/</link>
		<comments>http://www.jlip.de/c/inkrement-und-dekrement/#comments</comments>
		<pubDate>Sat, 10 Oct 2009 12:45:12 +0000</pubDate>
		<dc:creator>Harun (admin)</dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[Dekrement]]></category>
		<category><![CDATA[Inkrement]]></category>

		<guid isPermaLink="false">http://www.jlip.de/?p=231</guid>
		<description><![CDATA[Man kann Zahlen in C entweder um 1 erhöhen oder vermindern.
++ Zahl wird um 1 erhöht
--    Zahl wird um 1 vermindert
Bsp.
int i = 1;
double  x = 5, y;
char c = 'A';
i++;    // i = 2
x++;  // x = 6.0
c++;  // c = 'B'
i--;      // i = 1
x--;     // x = 5.0 [...]]]></description>
			<content:encoded><![CDATA[<p>Man kann Zahlen in C entweder um 1 erhöhen oder vermindern.<span id="more-231"></span></p>
<p>++ Zahl wird um 1 erhöht</p>
<p>--    Zahl wird um 1 vermindert</p>
<p>Bsp.</p>
<p>int i = 1;<br />
double  x = 5, y;<br />
char c = 'A';</p>
<p>i++;    // i = 2<br />
x++;  // x = 6.0<br />
c++;  // c = 'B'<br />
i--;      // i = 1<br />
x--;     // x = 5.0 da vorher ++<br />
c--;     // c = 'A' da vorher ++<br />
Die stellung der Variablen spielt dabei eine Rolle.<br />
1) Ink. / Dek. VOR einer Variable:<br />
- erst Ink. / Dek. dann Berechnung</p>
<p>2) Ink. / Dek. NACH einer Variable:<br />
- erst Berechnung dann Ink. / Dek.</p>
<p>Bsp.</p>
<p>int i = 1, j = 2, k;</p>
<p>k = i + j++ // k = 3, j = ++ also 3   -  1. Berechnung = 3    -  2. dann 1 zu j</p>
<p>-------------------------------------------</p>
<p>int i = 1, j = 2, k;</p>
<p>k = i++ +j; // k = 3, i = 2</p>
<p>-------------------------------------------<br />
int i = 1, j = 2, k;</p>
<p>k = ++i + j; // k = 4, i = 2</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jlip.de/c/inkrement-und-dekrement/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Logische Operatoren in C</title>
		<link>http://www.jlip.de/c/logische-operatoren-in-c/</link>
		<comments>http://www.jlip.de/c/logische-operatoren-in-c/#comments</comments>
		<pubDate>Sat, 10 Oct 2009 12:04:10 +0000</pubDate>
		<dc:creator>Harun (admin)</dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[logische operatoren]]></category>

		<guid isPermaLink="false">http://www.jlip.de/?p=227</guid>
		<description><![CDATA[C gibt es wie in der Digitaltechnik und vielen anderen Programmiersprachen Logische Operatoren.
&#38;&#38; logisches UND
&#124;&#124; logisches ODER
!  logische negation NICHT
Auswertung:
von links nach rechts aber nur solange bis das Ergebnis feststeht. Alles danach wird nicht mehr beachtet.
BSP:
int i = 1, j = 2, k = 2;
(i &#60; 2) &#124;&#124; (j == k);
// es kommt richtig rauß. [...]]]></description>
			<content:encoded><![CDATA[<p>C gibt es wie in der Digitaltechnik und vielen anderen Programmiersprachen Logische Operatoren.<span id="more-227"></span></p>
<p>&amp;&amp; logisches UND</p>
<p>|| logisches ODER</p>
<p>!  logische negation NICHT</p>
<p><strong>Auswertung:</strong></p>
<p>von links nach rechts aber nur solange bis das Ergebnis feststeht. Alles danach wird nicht mehr beachtet.</p>
<p><strong>BSP:</strong></p>
<p>int i = 1, j = 2, k = 2;</p>
<p>(i &lt; 2) || (j == k);</p>
<p>// es kommt richtig rauß. Da es eine ODER Verknüpfung ist und der erste vergleich stimmt, wird der Rest nicht mehr beachtet.</p>
<p>(i &lt; 2) &amp;&amp; ! (j == k);</p>
<p>// richtig, da 1. richtig und 2. wird falsch erwartet</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jlip.de/c/logische-operatoren-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vergleichsoperatoren in C</title>
		<link>http://www.jlip.de/c/vergleichsoperatoren-in-c/</link>
		<comments>http://www.jlip.de/c/vergleichsoperatoren-in-c/#comments</comments>
		<pubDate>Sat, 10 Oct 2009 11:32:06 +0000</pubDate>
		<dc:creator>Harun (admin)</dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[programmieren]]></category>
		<category><![CDATA[vergleichsopereatoren]]></category>

		<guid isPermaLink="false">http://www.jlip.de/?p=223</guid>
		<description><![CDATA[In C gibt es folgende Vergleichsoperatoren:

== (gleich) (achtung: = bei Zuweisung und == bei vergleich)
&#60; &#62;
!= (ungleich)
&#62;=
&#60;=
Auswertung von Links nach Rechts
Vorrang
&#62;, &#62;=, &#60;, &#60;=
vor
== und !=
Beispiel:
int i=1, j=2;
i &#60; 2;        // richtig
i == 2;      // falsch
i == j - 1;  // richtig
]]></description>
			<content:encoded><![CDATA[<p>In C gibt es folgende Vergleichsoperatoren:</p>
<p><span id="more-223"></span></p>
<p>== (gleich) (achtung: = bei Zuweisung und == bei vergleich)<br />
&lt; &gt;<br />
!= (ungleich)<br />
&gt;=<br />
&lt;=</p>
<p><strong>Auswertung </strong>von Links nach Rechts</p>
<p><strong>Vorrang</strong><br />
&gt;, &gt;=, &lt;, &lt;=<br />
vor<br />
== und !=</p>
<p>Beispiel:</p>
<p>int i=1, j=2;</p>
<p>i &lt; 2;        // richtig<br />
i == 2;      // falsch<br />
i == j - 1;  // richtig</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jlip.de/c/vergleichsoperatoren-in-c/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Übungen zu Operatoren in C</title>
		<link>http://www.jlip.de/c/ubungen-zu-operatoren-in-c/</link>
		<comments>http://www.jlip.de/c/ubungen-zu-operatoren-in-c/#comments</comments>
		<pubDate>Sat, 10 Oct 2009 11:04:07 +0000</pubDate>
		<dc:creator>Harun (admin)</dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[operatoren]]></category>

		<guid isPermaLink="false">http://www.jlip.de/?p=218</guid>
		<description><![CDATA[Sorry erstmal, dass es dieses Mal so lange gedauert hat. Heute kommen ein paar Übungen zu Operatoren in C, damit die richtig sitzen   Die Lösung findet ihr wie immer ganz unten auf der Seite. Ich bitte euch aber ersteinmal das Programm selbst zu schreiben, damit ihr euer wissen überprüfen könnt. Wenn ihr einmal [...]]]></description>
			<content:encoded><![CDATA[<p>Sorry erstmal, dass es dieses Mal so lange gedauert hat. Heute kommen ein paar Übungen zu <a href="http://www.jlip.de/c/operatoren-in-c/">Operatoren in C</a>, damit die richtig sitzen <img src='http://www.jlip.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Die Lösung findet ihr wie immer ganz unten auf der Seite. Ich bitte euch aber ersteinmal das Programm selbst zu schreiben, damit ihr euer wissen überprüfen könnt. Wenn ihr einmal nicht weiterwisst empfehle ich euch die <a href="http://www.jlip.de/ka/c/">früheren Posts</a> euch anzuschauen.<span id="more-218"></span></p>
<ul>
<li><strong>Aufgabe 1.)</strong></li>
</ul>
<p>Erstelle ein Program, das mit 3 int-variablen und 3 double-variablen arithmetische Berechnungen durchführt.<br />
Das Ergebnis soll nach der Berechnung auf dem Bildschirm angezeigt werden.</p>
<p>a) Verwende alle Arithmetische Operatoren mit den int-Variablen<br />
b) Verwende alle Arithmetische Operatoren mit den double-Variablen<br />
c) Probiere die Berechnungen mit vermischten Datentypen (z.B. int * double; double + int)<br />
Was passiert, wenn das Ergebnis der double Berechnung mit einer int- Variable ausgegeben wird?</p>
<ul>
<li><strong>Aufgabe 2.)</strong></li>
</ul>
<p>Erstelle ein Programm, das mit dem Radius r von einem Kreis den Umfang U und die Fläche A berechnet und ausgibt.<br />
Tipp: U = 2 * (pi) * r  und  A = (pi) * r * r<br />
Um (pi) als Konstante einzubinden muss man erst im Header wie das conio.h, math.h includen danach kann man mit "M_PI" es verwenden da wo man haben möchte.</p>
<ul>
<li><strong>Aufgabe 3.)</strong></li>
</ul>
<p>Das Programm soll mit der Hochstpunktzahl einer Klassenarbeit und den erreichten Punkten die Note errechnen.<br />
Formel:  Note = 6.0 - erP/maxP * 5.0<br />
Die Punkte angaben sollen vom Nutzer eingegebn werden.</p>
<ul>
<li><strong>Aufgabe 4.)</strong></li>
</ul>
<p>Ein Programm soll den Spritverbrauch eines Fahrzeugs mit Hilfe der Tankfüllung und den Gefahrenen Kilometern errechnen.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>..</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>..</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>..</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<pre class="cpp">&nbsp;
<span style="color: #339900;">#include &lt; conio.h&gt;</span>
<span style="color: #339900;">#include &lt; stdio.h&gt;</span>
<span style="color: #339900;">#include &lt; math.h&gt;</span>
&nbsp;
<span style="color: #0000ff;">int</span> main <span style="color: #000000;">&#40;</span><span style="color: #0000ff;">void</span><span style="color: #000000;">&#41;</span>
&nbsp;
<span style="color: #000000;">&#123;</span>
&nbsp;
<span style="color: #0000ff;">int</span> i=<span style="color: #0000dd;">1</span>, j=<span style="color: #0000dd;">4</span>, k=<span style="color: #0000dd;">8</span>;
<span style="color: #0000ff;">double</span> di=<span style="color: #0000dd;">5.5</span>, dj=<span style="color: #0000dd;">7.8</span>, dk=<span style="color: #0000dd;">3.5</span>;
&nbsp;
<span style="color: #0000ff;">int</span> addiint = i+j ;
<span style="color: #0000ff;">int</span> subint = j-i ;
<span style="color: #0000ff;">int</span> mulint = j*k;
<span style="color: #0000ff;">int</span> divint = k/j;
&nbsp;
<span style="color: #0000ff;">double</span> adddoub = dj+di;
<span style="color: #0000ff;">double</span> subdoub = dj-di;
<span style="color: #0000ff;">double</span> muldoub = dk*di;
<span style="color: #0000ff;">double</span> divdoub = dj/di;
                          <span style="color: #ff0000;">//-------------- Alle Opperatoren mit Ganzzahlen</span>
   <span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;erstens %d<span style="color: #666666; font-weight: bold;">\n</span>&quot;</span>, addiint<span style="color: #000000;">&#41;</span>;        getch<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
   <span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;zweitens %d<span style="color: #666666; font-weight: bold;">\n</span>&quot;</span>, subint<span style="color: #000000;">&#41;</span>;            getch<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
      <span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;drittens %d<span style="color: #666666; font-weight: bold;">\n</span>&quot;</span>, mulint<span style="color: #000000;">&#41;</span>;             getch<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
         <span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;viertens %d<span style="color: #666666; font-weight: bold;">\n</span><span style="color: #666666; font-weight: bold;">\n</span><span style="color: #666666; font-weight: bold;">\n</span>&quot;</span>, divint<span style="color: #000000;">&#41;</span>;         getch<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
                            <span style="color: #ff0000;">//-------------- Alle Opperatoren mit Kommazahlen</span>
            <span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;erstens %lf<span style="color: #666666; font-weight: bold;">\n</span>&quot;</span>, adddoub<span style="color: #000000;">&#41;</span>;           getch<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
   <span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;zweitens %lf<span style="color: #666666; font-weight: bold;">\n</span>&quot;</span>, subdoub<span style="color: #000000;">&#41;</span>;                       getch<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
      <span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;drittens %lf<span style="color: #666666; font-weight: bold;">\n</span>&quot;</span>, muldoub<span style="color: #000000;">&#41;</span>;                     getch<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
         <span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;viertens %lf<span style="color: #666666; font-weight: bold;">\n</span><span style="color: #666666; font-weight: bold;">\n</span><span style="color: #666666; font-weight: bold;">\n</span>&quot;</span>, divdoub<span style="color: #000000;">&#41;</span>;               getch<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #0000ff;">int</span> misch1 = i+di ;
<span style="color: #0000ff;">int</span> misch2 = dj-i ;
<span style="color: #0000ff;">int</span> misch3 = j*dk;
<span style="color: #0000ff;">int</span> misch4 = k/dj;
                           <span style="color: #ff0000;">//-------------- Alle Opperatoren mit gemischtenzahlen   als int ausgegeben</span>
   <span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;erstens %d<span style="color: #666666; font-weight: bold;">\n</span>&quot;</span>, misch1<span style="color: #000000;">&#41;</span>;                           getch<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
   <span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;zweitens %d<span style="color: #666666; font-weight: bold;">\n</span>&quot;</span>, misch2<span style="color: #000000;">&#41;</span>;                           getch<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
      <span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;drittens %d<span style="color: #666666; font-weight: bold;">\n</span>&quot;</span>, misch3<span style="color: #000000;">&#41;</span>;                         getch<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
         <span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;viertens %d<span style="color: #666666; font-weight: bold;">\n</span><span style="color: #666666; font-weight: bold;">\n</span><span style="color: #666666; font-weight: bold;">\n</span>&quot;</span>, misch4<span style="color: #000000;">&#41;</span>;                   getch<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #0000ff;">double</span> misch5 = i+di;
<span style="color: #0000ff;">double</span> misch6 = dj-i;
<span style="color: #0000ff;">double</span> misch7 = j*dk;
<span style="color: #0000ff;">double</span> misch8 = k/dj;
&nbsp;
                           <span style="color: #ff0000;">//-------------- Alle Opperatoren mit gemischtenzahlen   als double ausgegeben</span>
   <span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;erstens %lf<span style="color: #666666; font-weight: bold;">\n</span>&quot;</span>, misch5<span style="color: #000000;">&#41;</span>;                            getch<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
   <span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;zweitens %lf<span style="color: #666666; font-weight: bold;">\n</span>&quot;</span>, misch6<span style="color: #000000;">&#41;</span>;                           getch<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
      <span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;drittens %lf<span style="color: #666666; font-weight: bold;">\n</span>&quot;</span>, misch7<span style="color: #000000;">&#41;</span>;                         getch<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
         <span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;viertens %lf<span style="color: #666666; font-weight: bold;">\n</span><span style="color: #666666; font-weight: bold;">\n</span><span style="color: #666666; font-weight: bold;">\n</span>&quot;</span>, misch8<span style="color: #000000;">&#41;</span>;                    getch<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
                    <span style="color: #ff0000;">//----------- KREISRECHNUNGEN _---------_________----------</span>
<span style="color: #0000ff;">double</span> r, pi=M_PI, a, u;
&nbsp;
<span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Bitte den Radius eingeben<span style="color: #666666; font-weight: bold;">\n</span>&quot;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #0000dd;">scanf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;%lf&quot;</span>,&amp;r<span style="color: #000000;">&#41;</span>;
&nbsp;
a=pi*r*r;
u=<span style="color: #0000dd;">2</span>*pi*r;
&nbsp;
 <span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Die Flaeche ist %lf<span style="color: #666666; font-weight: bold;">\n</span>&quot;</span>,a<span style="color: #000000;">&#41;</span>;
 <span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Der Umfang ist %lf<span style="color: #666666; font-weight: bold;">\n</span>&quot;</span>,u<span style="color: #000000;">&#41;</span>;
&nbsp;
                   <span style="color: #ff0000;">//----------- noten  RECHNUNGEN _---------_________----------</span>
<span style="color: #0000ff;">double</span> note, erp, maxp;
<span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Bitte die erreichten Punkte eingeben<span style="color: #666666; font-weight: bold;">\n</span>&quot;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #0000dd;">scanf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;%lf&quot;</span>,&amp;erp<span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Bitte die maximal Punkte Punkte eingeben<span style="color: #666666; font-weight: bold;">\n</span><span style="color: #666666; font-weight: bold;">\n</span>&quot;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #0000dd;">scanf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;%lf&quot;</span>,&amp;maxp<span style="color: #000000;">&#41;</span>;
&nbsp;
note=<span style="color: #0000dd;">6</span>-erp/maxp*<span style="color: #0000dd;">5</span>;
&nbsp;
<span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Die Note ist %lf<span style="color: #666666; font-weight: bold;">\n</span><span style="color: #666666; font-weight: bold;">\n</span><span style="color: #666666; font-weight: bold;">\n</span>&quot;</span>,note<span style="color: #000000;">&#41;</span>;
                      <span style="color: #ff0000;">//----------- durchschnittsverbrauch  RECHNUNGEN _---------_________----------</span>
<span style="color: #0000ff;">double</span> tank, fahrt, durchschnitt;
 <span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Bitte die Tankfuellung eingeben<span style="color: #666666; font-weight: bold;">\n</span>&quot;</span><span style="color: #000000;">&#41;</span>;
   <span style="color: #0000dd;">scanf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;%lf&quot;</span>,&amp;tank<span style="color: #000000;">&#41;</span>;
     <span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Bitte die gefahrenen KM eingeben<span style="color: #666666; font-weight: bold;">\n</span>&quot;</span><span style="color: #000000;">&#41;</span>;
   <span style="color: #0000dd;">scanf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;%lf&quot;</span>,&amp;fahrt<span style="color: #000000;">&#41;</span>;
&nbsp;
durchschnitt=fahrt/tank;
 <span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Der Durschnitt ist %lf&quot;</span>,durchschnitt<span style="color: #000000;">&#41;</span>;
&nbsp;
   getch<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
   <span style="color: #000000;">&#125;</span></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.jlip.de/c/ubungen-zu-operatoren-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Operatoren in C</title>
		<link>http://www.jlip.de/c/operatoren-in-c/</link>
		<comments>http://www.jlip.de/c/operatoren-in-c/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 13:16:11 +0000</pubDate>
		<dc:creator>Harun (admin)</dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[coden]]></category>
		<category><![CDATA[operatoren]]></category>

		<guid isPermaLink="false">http://www.jlip.de/?p=212</guid>
		<description><![CDATA[1) Zuweisung
Die Zuweisung eines Wertes geschieht mit     =
Links davon steht die VARIABLE, die einen Wert erhält.
Die Variable auf der recehten Seite wird nicht verändert.
In C werden bei der Zuweisung von Kommazahlen an Ganzzahlen die Kommastellen abgeschnitten.
Beispiel:
int i;
&#160;
double x=3.75;
&#160;
i=x;  // i ist dann 3 weil es abgeschnitten wird.
2) Vorzeichen
+ ist eine positive Zahl und - eine [...]]]></description>
			<content:encoded><![CDATA[<p><strong>1) Zuweisung</strong></p>
<p>Die Zuweisung eines Wertes geschieht mit     =</p>
<p>Links davon steht die VARIABLE, die einen Wert erhält.<br />
Die Variable auf der recehten Seite wird nicht verändert.</p>
<p>In C werden bei der Zuweisung von Kommazahlen an Ganzzahlen die Kommastellen abgeschnitten.<span id="more-212"></span></p>
<p>Beispiel:</p>
<pre class="cpp"><span style="color: #0000ff;">int</span> i;
&nbsp;
<span style="color: #0000ff;">double</span> x=<span style="color: #0000dd;">3.75</span>;
&nbsp;
i=x;  <span style="color: #ff0000;">// i ist dann 3 weil es abgeschnitten wird.</span></pre>
<p><strong>2) Vorzeichen</strong></p>
<p>+ ist eine positive Zahl und - eine negative</p>
<p><strong>3) Arithmetische Operatoren</strong></p>
<p>+ - * / %</p>
<p>Bei der Division (/) mit int (Beide Operatoren sind Ganzzahlen)  wird der Bruchteil (Kommastelle) abgeschnitten.</p>
<p>Beispiel:</p>
<pre class="cpp"><span style="color: #0000ff;">int</span> i=<span style="color: #0000dd;">1</span>, j=<span style="color: #0000dd;">2</span>, k;
<span style="color: #0000ff;">double</span> x;
k=i/j; <span style="color: #ff0000;">// k ist somit 0</span>
x=i/j; <span style="color: #ff0000;">// x ist dann o.o</span></pre>
<p>Modulo (%) Divisionen die nur auf Ganzzahlen anwendbar ist berechnet den Restwert einer Ganzzahlendivision. Wie man es aus der Grundschule kennt, bevor man mit den Kommzahlen vertraut gemacht wird.</p>
<p>Beispiel:</p>
<pre class="cpp"><span style="color: #0000ff;">int</span> i=<span style="color: #0000dd;">10</span>, j=<span style="color: #0000dd;">2</span>, k=<span style="color: #0000dd;">3</span>, erg;
erg=i%k; <span style="color: #ff0000;">// erg ist dann 1! weil 10 durch 3 gibt 3 rest 1</span>
erg=j%k; <span style="color: #ff0000;">// erg ist 2</span>
erg=i%<span style="color: #0000dd;">4</span>; <span style="color: #ff0000;">// erg ist 2</span></pre>
<p>Auswertung der Rechnung erfolgt von LINKS nach Rechts, wie man es von der Mathematik kennt.<br />
Dabei gilt: * / % geht vor + und -</p>
<p>Beispiel:</p>
<pre class="cpp">erg=i+j*k/<span style="color: #0000dd;">5</span>; <span style="color: #ff0000;">// erg ist dann 11</span></pre>
<p>Das Mischen von Datentypen ist erlaubt. Die Berechnung wird dann im "besseren" Datentyp ausgeführt.</p>
<p>Beispiel:</p>
<pre class="cpp"><span style="color: #0000ff;">int</span> i=<span style="color: #0000dd;">1</span>, j=<span style="color: #0000dd;">2</span>, k;
<span style="color: #0000ff;">double</span> x=<span style="color: #0000dd;">2.0</span>, erg;
&nbsp;
erg=i/x; <span style="color: #ff0000;">// 0.5</span>
erg=i/j; <span style="color: #ff0000;">// 0.0 Ganzhaldivision</span>
k=i/x;   <span style="color: #ff0000;">// 0 da k ein int ist</span></pre>
<p><strong>Erzwungene Typumwandlung (cast)</strong><br />
(Datentyp) Variable<br />
erzwingt die Behandlung der Variable in diesem Typ an dieser Stelle!</p>
<p>Beispiel:</p>
<pre class="cpp">erg=<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">double</span><span style="color: #000000;">&#41;</span> i/j; <span style="color: #ff0000;">// 0.5 nur hier wird es double bahndelt</span></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.jlip.de/c/operatoren-in-c/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Übung zu Variablen</title>
		<link>http://www.jlip.de/c/ubung-zu-variablen/</link>
		<comments>http://www.jlip.de/c/ubung-zu-variablen/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 14:29:15 +0000</pubDate>
		<dc:creator>Harun (admin)</dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[einlesen]]></category>
		<category><![CDATA[variable]]></category>
		<category><![CDATA[variablen]]></category>

		<guid isPermaLink="false">http://www.jlip.de/?p=196</guid>
		<description><![CDATA[Heute gibt es eine Übung zu den Variablen, damit es richtig sitzt.
Alles soll durch ein Programm realisiert werden.
1. Eine Char-Variable einlesen (Zahl, Zeichen oder Sonderzeichen), dann als Zeichen UND als Zahl ausgeben.
2. Hintereinander 3 int Variablen einlesen. Danach erst die zweite dann die erste dann dritte Variable ausgeben.
3. Eine Kommazahl mit Float einlesen dann, als [...]]]></description>
			<content:encoded><![CDATA[<p>Heute gibt es eine Übung zu den Variablen, damit es richtig sitzt.<br />
Alles soll durch ein Programm realisiert werden.</p>
<p>1. Eine Char-Variable einlesen (Zahl, Zeichen oder Sonderzeichen), dann als Zeichen UND als Zahl ausgeben.<br />
2. Hintereinander 3 int Variablen einlesen. Danach erst die zweite dann die erste dann dritte Variable ausgeben.<br />
3. Eine Kommazahl mit Float einlesen dann, als Datentyp: g, f und e ausgeben.<br />
4. double einlesen dann als Datentyp: g,f,e ausgeben.</p>
<p>Die Lösung steht unten:</p>
<p><span id="more-196"></span></p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>.</p>
<pre class="cpp"><span style="color: #ff0000;">// Übung zu den Variablen</span>
&nbsp;
<span style="color: #339900;">#include</span>
<span style="color: #339900;">#include </span>
&nbsp;
<span style="color: #0000ff;">int</span> main<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">void</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
&nbsp;
<span style="color: #ff0000;">// Aufgabe 1</span>
 <span style="color: #0000ff;">char</span> zeichen;
 <span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Bitte ein Zeichen eingeben<span style="color: #666666; font-weight: bold;">\n</span>&quot;</span><span style="color: #000000;">&#41;</span>;
 <span style="color: #0000dd;">scanf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;%c&quot;</span>,&amp;zeichen<span style="color: #000000;">&#41;</span>;                    <span style="color: #ff0000;">// liest das Zeichen in die Variable &quot;zeichen&quot; ein</span>
 <span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Du hast %c eingegeben<span style="color: #666666; font-weight: bold;">\n</span>&quot;</span>, zeichen<span style="color: #000000;">&#41;</span>; <span style="color: #ff0000;">// Ausgabe der Variable &quot;zeichen&quot;</span>
 <span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Als Zahl ergibt das %i im ASCII CODE<span style="color: #666666; font-weight: bold;">\n</span>&quot;</span>, zeichen<span style="color: #000000;">&#41;</span>;  <span style="color: #ff0000;">// Ausgabe als ASCII Code</span>
&nbsp;
<span style="color: #ff0000;">// Aufgabe 2  ------------------------------------------------------------------------------</span>
 <span style="color: #0000ff;">int</span> zahl1;
 <span style="color: #0000ff;">int</span> zahl2;
 <span style="color: #0000ff;">int</span> zahl3;
&nbsp;
 <span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Gib deine erste Zahl ein<span style="color: #666666; font-weight: bold;">\n</span>&quot;</span><span style="color: #000000;">&#41;</span>;
 <span style="color: #0000dd;">scanf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;%i&quot;</span>,&amp;zahl1<span style="color: #000000;">&#41;</span>;
 <span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Gib deine zweite Zahl ein<span style="color: #666666; font-weight: bold;">\n</span>&quot;</span><span style="color: #000000;">&#41;</span>;
 <span style="color: #0000dd;">scanf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;%i&quot;</span>,&amp;zahl2<span style="color: #000000;">&#41;</span>;
 <span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Gib deine dritte Zahl ein<span style="color: #666666; font-weight: bold;">\n</span>&quot;</span><span style="color: #000000;">&#41;</span>;
 <span style="color: #0000dd;">scanf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;%i&quot;</span>,&amp;zahl3<span style="color: #000000;">&#41;</span>;
 <span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Die Zweite Zahl war %i deine erste %i und deine dritte %i<span style="color: #666666; font-weight: bold;">\n</span>&quot;</span>, zahl2,zahl1,zahl3<span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #ff0000;">// Aufgabe 3 -------------------------------------------------------------------------------</span>
 <span style="color: #0000ff;">float</span> kommazahl;
 <span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Gib deine Kommazahl ein<span style="color: #666666; font-weight: bold;">\n</span>&quot;</span><span style="color: #000000;">&#41;</span>;
 <span style="color: #0000dd;">scanf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;%f&quot;</span>,&amp;kommazahl<span style="color: #000000;">&#41;</span>;
 <span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Variable im Format g: %g<span style="color: #666666; font-weight: bold;">\n</span>&quot;</span>, kommazahl<span style="color: #000000;">&#41;</span>;
 <span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Variable im Format f: %f<span style="color: #666666; font-weight: bold;">\n</span>&quot;</span>, kommazahl<span style="color: #000000;">&#41;</span>;
 <span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Variable im Format e: %e<span style="color: #666666; font-weight: bold;">\n</span>&quot;</span>, kommazahl<span style="color: #000000;">&#41;</span>; 
&nbsp;
<span style="color: #ff0000;">// Aufgabe 4 ----------------------------------------------------------------------------</span>
&nbsp;
 <span style="color: #0000ff;">double</span> blabla;
&nbsp;
  <span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Gib deine double Zahl ein<span style="color: #666666; font-weight: bold;">\n</span>&quot;</span><span style="color: #000000;">&#41;</span>;
  <span style="color: #0000dd;">scanf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;%lf&quot;</span>,&amp;blabla<span style="color: #000000;">&#41;</span>;
  <span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;dein double im Format g: %g<span style="color: #666666; font-weight: bold;">\n</span>&quot;</span>, blabla<span style="color: #000000;">&#41;</span>;
  <span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;dein double im Format f: %f<span style="color: #666666; font-weight: bold;">\n</span>&quot;</span>, blabla<span style="color: #000000;">&#41;</span>;
  <span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;dein double im Format e: %e<span style="color: #666666; font-weight: bold;">\n</span>&quot;</span>, blabla<span style="color: #000000;">&#41;</span>; 
&nbsp;
<span style="color: #ff0000;">// ENDE</span>
&nbsp;
<span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Glückwunsch du hast es geschafft.... nun kannste schlafen gehen&quot;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
 getch<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #000000;">&#125;</span></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.jlip.de/c/ubung-zu-variablen/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Variablen und Datentypen in Python</title>
		<link>http://www.jlip.de/python/variablen-und-datentypen-in-python/</link>
		<comments>http://www.jlip.de/python/variablen-und-datentypen-in-python/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 13:09:22 +0000</pubDate>
		<dc:creator>BackRaw</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.jlip.de/?p=165</guid>
		<description><![CDATA[Da das erste Beispielprogramm doch ein wenig zu kompliziert für wirkliche Anfänger war, starte ich einen neuen Versuch mit Variablen und Datentypen.

Datentypen
Dies sind Typen, mit denen man in Python arbeiten kann, zu ihnen gehören:

int

Integer - Ganzzahl

int() -> Konvertierung zu einer Ganzzahl




float

Floating Number - Fließkommazahl, Dezimalzahl

float() -> Konvertierung zu einer Dezimalzahl




str

String - Zeichenkette

str() -> Konvertierung zu [...]]]></description>
			<content:encoded><![CDATA[<p>Da das erste Beispielprogramm doch ein wenig zu kompliziert für wirkliche Anfänger war, starte ich einen neuen Versuch mit Variablen und Datentypen.</p>
<p><span id="more-165"></span></p>
<p><strong>Datentypen</strong></p>
<p>Dies sind Typen, mit denen man in Python arbeiten kann, zu ihnen gehören:</p>
<ul>
<li>int
<ul>
<li>Integer - Ganzzahl
<ul>
<li>int() -> Konvertierung zu einer Ganzzahl</li>
</ul>
</li>
</ul>
</li>
<li>float
<ul>
<li>Floating Number - Fließkommazahl, Dezimalzahl
<ul>
<li>float() -> Konvertierung zu einer Dezimalzahl</li>
</ul>
</li>
</ul>
</li>
<li>str
<ul>
<li>String - Zeichenkette
<ul>
<li>str() -> Konvertierung zu einer Zeichenkette</li>
</ul>
</li>
</ul>
</li>
<li>list
<ul>
<li>Liste
<ul>
<li>list() oder []</li>
</ul>
</li>
</ul>
</li>
<li>dict
<ul>
<li>Dictionary - in anderen Sprachen bekannt als Array
<ul>
<li>dict() oder {}</li>
</ul>
</li>
</ul>
</li>
<li>bool
<ul>
<li>Boolscher Wert
<ul>
<li>bool() -> True oder False</li>
</ul>
</li>
</ul>
</li>
<li>tuple
<ul>
<li>Unveränderbare Liste
<ul>
<li>tuple() -> Konvertierung zu einer unveränderbaren Liste</li>
</ul>
</li>
</ul>
</li>
<li>set
<ul>
<li>Liste ohne Duplikate, Slicing, Indexing
<ul>
<li>set()</li>
</ul>
</li>
</ul>
</li>
</ul>
<p><strong>Beispiele<br />
</strong></p>
<pre class="python"><span style="color: #808080; font-style: italic;"># int</span>
a = <span style="color: #ff4500;">1</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># float</span>
a = <span style="color: #ff4500;">1.0</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># str</span>
a = <span style="color: #483d8b;">'1'</span>
<span style="color: #808080; font-style: italic;"># oder</span>
a = <span style="color: #483d8b;">'Ich bin BackRaw'</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># list</span>
a = <span style="color: black;">&#91;</span><span style="color: #483d8b;">'hi'</span>, <span style="color: #483d8b;">'how'</span>, <span style="color: #483d8b;">'are'</span>, <span style="color: #483d8b;">'you'</span><span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Slicing:</span>
a.<span style="color: black;">remove</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'hi'</span><span style="color: black;">&#41;</span> <span style="color: #808080; font-style: italic;"># -&gt; a ist jetzt:</span>
<span style="color: black;">&#91;</span><span style="color: #483d8b;">'how'</span>, <span style="color: #483d8b;">'are'</span>, <span style="color: #483d8b;">'you'</span><span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Indexing:</span>
a<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span> = <span style="color: #483d8b;">'lol'</span> <span style="color: #808080; font-style: italic;"># -&gt; a ist jetzt:</span>
<span style="color: black;">&#91;</span><span style="color: #483d8b;">'lol'</span>, <span style="color: #483d8b;">'are'</span>, <span style="color: #483d8b;">'you'</span><span style="color: black;">&#93;</span>
&nbsp;
a.<span style="color: black;">pop</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span>
<span style="color: #808080; font-style: italic;"># oder</span>
<span style="color: #ff7700;font-weight:bold;">del</span> a<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># -&gt; a ist jetzt:</span>
<span style="color: black;">&#91;</span><span style="color: #483d8b;">'are'</span>, <span style="color: #483d8b;">'you'</span><span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># 0 ist in Python immer das erste, Python zählt nicht so wie wir es kennen:</span>
    <span style="color: #808080; font-style: italic;"># 1, 2, 3, 4 - sondern:</span>
    <span style="color: #808080; font-style: italic;"># 0, 1, 2, 3</span>
    <span style="color: #808080; font-style: italic;"># wobei 0 das erste, 1 das zweite, 2 das dritte und 3 das vierte Element ist</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Dictionary:</span>
a = <span style="color: black;">&#123;</span><span style="color: #483d8b;">'name'</span>:<span style="color: #483d8b;">'BackRaw'</span>,
     <span style="color: #483d8b;">'age'</span>:<span style="color: #ff4500;">16</span>,
     <span style="color: #483d8b;">'real age'</span>:<span style="color: #ff4500;">16.8</span>,
     <span style="color: #483d8b;">'his list'</span>:<span style="color: black;">&#91;</span><span style="color: #483d8b;">'hello world'</span>, <span style="color: #483d8b;">&quot;I'm BackRaw&quot;</span><span style="color: black;">&#93;</span>,
     <span style="color: #483d8b;">'his dict'</span>:<span style="color: black;">&#123;</span><span style="color: #483d8b;">'a'</span>:<span style="color: #483d8b;">'Bessy'</span><span style="color: black;">&#125;</span>
     <span style="color: black;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Man kann in Dicts alle möglichen Datatypen definieren, auslesen, und verändern...</span>
a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'name'</span><span style="color: black;">&#93;</span>          <span style="color: #808080; font-style: italic;"># -&gt; 'BackRaw'</span>
a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'age'</span><span style="color: black;">&#93;</span>           <span style="color: #808080; font-style: italic;"># -&gt; 16</span>
a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'his list'</span><span style="color: black;">&#93;</span>      <span style="color: #808080; font-style: italic;"># -&gt; ['hello world', &quot;I'm BackRaw&quot;]</span>
a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'his list'</span><span style="color: black;">&#93;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span>   <span style="color: #808080; font-style: italic;"># -&gt; 'hello world'</span>
a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'his dict'</span><span style="color: black;">&#93;</span>      <span style="color: #808080; font-style: italic;"># -&gt; {'a':'Bessy'}</span>
a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'his dict'</span><span style="color: black;">&#93;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'a'</span><span style="color: black;">&#93;</span> <span style="color: #808080; font-style: italic;"># -&gt; 'Bessy'</span>
&nbsp;
a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'name'</span><span style="color: black;">&#93;</span> = <span style="color: #483d8b;">'NOOB!'</span>
a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'name'</span><span style="color: black;">&#93;</span>          <span style="color: #808080; font-style: italic;"># -&gt; 'NOOB!'</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># bool</span>
a = <span style="color: #008000;">True</span>
<span style="color: #008000;">bool</span><span style="color: black;">&#40;</span>a<span style="color: black;">&#41;</span> <span style="color: #808080; font-style: italic;"># -&gt; True</span>
&nbsp;
a = <span style="color: #008000;">False</span>
<span style="color: #008000;">bool</span><span style="color: black;">&#40;</span>a<span style="color: black;">&#41;</span> <span style="color: #808080; font-style: italic;"># -&gt; False</span>
&nbsp;
a = <span style="color: #ff4500;">1</span>
<span style="color: #008000;">bool</span><span style="color: black;">&#40;</span>a<span style="color: black;">&#41;</span> <span style="color: #808080; font-style: italic;"># -&gt; True</span>
&nbsp;
a = <span style="color: #ff4500;">-1</span>
<span style="color: #008000;">bool</span><span style="color: black;">&#40;</span>a<span style="color: black;">&#41;</span> <span style="color: #808080; font-style: italic;"># -&gt; True</span>
&nbsp;
a = <span style="color: #ff4500;">0</span>
<span style="color: #008000;">bool</span><span style="color: black;">&#40;</span>a<span style="color: black;">&#41;</span> <span style="color: #808080; font-style: italic;"># -&gt; False</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># tuple</span>
a = <span style="color: black;">&#91;</span><span style="color: #483d8b;">'1'</span>, <span style="color: #483d8b;">'s'</span>, <span style="color: #483d8b;">'hallo'</span>, <span style="color: #483d8b;">'lol'</span><span style="color: black;">&#93;</span>
<span style="color: #008000;">tuple</span><span style="color: black;">&#40;</span>a<span style="color: black;">&#41;</span>
<span style="color: black;">&#40;</span><span style="color: #483d8b;">'1'</span>, <span style="color: #483d8b;">'s'</span>, <span style="color: #483d8b;">'hallo'</span>, <span style="color: #483d8b;">'lol'</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Sets möchte ich erst gar nicht näher erklären, da ich sie persönlich nicht benutze.</span>
<span style="color: #808080; font-style: italic;"># Ich bevorzuge Lists gegenüber Sets, da sie Slicing und Indexing unterstützen.</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Konvertierung von Strings:</span>
a = <span style="color: #483d8b;">'1'</span>
<span style="color: #008000;">int</span><span style="color: black;">&#40;</span>a<span style="color: black;">&#41;</span> <span style="color: #808080; font-style: italic;"># -&gt; 1</span>
&nbsp;
a = <span style="color: #483d8b;">'1.0'</span>
<span style="color: #008000;">float</span><span style="color: black;">&#40;</span>a<span style="color: black;">&#41;</span> <span style="color: #808080; font-style: italic;"># -&gt; 1.0</span></pre>
<p><strong> Variablen</strong></p>
<p>Sie sind lediglich Platzhalter, man kann sie definieren, auslesen und verändern. Python ist deswegen für mich eine sehr einfache Sprache, da man die Variablen nicht mit den Typen deklarieren muss.</p>
<p>Ein kleines Beispiel in C/C++:</p>
<pre class="cpp"><span style="color: #0000ff;">int</span> a = <span style="color: #0000dd;">3</span>;
string b = <span style="color: #666666;">&quot;Hallo!&quot;</span>;
<span style="color: #0000ff;">double</span> c = <span style="color: #0000dd;">1.0</span>;
<span style="color: #ff0000;">// double ist das selbe wie float in Python.</span></pre>
<p>Jetzt in Python:</p>
<pre class="python">a = <span style="color: #ff4500;">3</span>
b = <span style="color: #483d8b;">'Hallo!'</span>
c = <span style="color: #ff4500;">1.0</span></pre>
<p>Auffallend ist auch, dass man bei Python kein Semikolon (;) am Ende eines Befehls braucht.</p>
<p>Ich hoffe dies hat euch weitergeholfen =)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jlip.de/python/variablen-und-datentypen-in-python/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Einlesen und ausgeben von Variablen mit scanf</title>
		<link>http://www.jlip.de/c/einlesen-und-ausgeben-von-variablen-mit-scanf/</link>
		<comments>http://www.jlip.de/c/einlesen-und-ausgeben-von-variablen-mit-scanf/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 11:02:58 +0000</pubDate>
		<dc:creator>Harun (admin)</dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[einlesen]]></category>
		<category><![CDATA[scanf]]></category>
		<category><![CDATA[variablen]]></category>

		<guid isPermaLink="false">http://www.jlip.de/?p=145</guid>
		<description><![CDATA[Einlesen
Mit dem Befehl scanf wartet das Programm auf eine Eingabe über die Tastatur. Diese Eingabe kann man wiederrum in eine Variable abspeichern und später dann aufrufen. Bevor man aber etwas eingeben kann, muss man den genauen Datentyp bekannt machen.
Beispiel:
scanf&#40;&#34;%i&#34;, &#38;k&#41;;   /* Liest in die int-Variable k ein.
Zuerst den Datentyp bestimmen danach die Variable angeben */
&#160;
scanf&#40;&#34;%i&#34;, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Einlesen</strong></p>
<p>Mit dem Befehl <a href="http://hackedgadgets.com/2009/09/04/printf-and-scanf-examples-for-microcontrollers/trackback/">scanf</a> wartet das Programm auf eine Eingabe über die Tastatur. Diese Eingabe kann man wiederrum in eine Variable abspeichern und später dann aufrufen. Bevor man aber etwas eingeben kann, muss man den genauen Datentyp bekannt machen.<span id="more-145"></span></p>
<p>Beispiel:</p>
<pre class="cpp"><span style="color: #0000dd;">scanf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;%i&quot;</span>, &amp;k<span style="color: #000000;">&#41;</span>;   <span style="color: #ff0000; font-style: italic;">/* Liest in die int-Variable k ein.
Zuerst den Datentyp bestimmen danach die Variable angeben */</span>
&nbsp;
<span style="color: #0000dd;">scanf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;%i&quot;</span>, &amp;c<span style="color: #000000;">&#41;</span>;  <span style="color: #ff0000; font-style: italic;">/* Liest in die int-Variable c ein */</span></pre>
<p><strong>Ausgeben</strong></p>
<p>Da wir nun durch eine Eingabe eine Zahl in den Variablen k und c gespeichert haben, könne wir sie durch eine Bildschirmausgabe aufrufen. Wir können sie auch addieren, multiplizieren usw. aber das kommt später <img src='http://www.jlip.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
Genau wie scanf muss auch printf  den Datentyp kennen welchen ausgegeben soll.</p>
<p>Beispiel:</p>
<pre class="cpp"><span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Du hast die Zahl %i eingegeben&quot;</span>, k<span style="color: #000000;">&#41;</span>;  <span style="color: #ff0000; font-style: italic;">/* Man schreibt
den Datentyp rein und am Schluss die Variable die man dort haben
möchte */</span></pre>
<p>Komplett-Programm:</p>
<pre class="cpp"><span style="color: #339900;">#include</span>
<span style="color: #339900;">#include </span>
&nbsp;
<span style="color: #0000ff;">int</span> main<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">void</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #0000ff;">int</span> zahl1;
<span style="color: #0000ff;">int</span> zahl2;
&nbsp;
<span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Wie alt bist du?<span style="color: #666666; font-weight: bold;">\n</span>&quot;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #0000dd;">scanf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;%i&quot;</span>, &amp;zahl1<span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Und wie alt ist deine Mutter?<span style="color: #666666; font-weight: bold;">\n</span>&quot;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #0000dd;">scanf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;%i&quot;</span>, &amp;zahl2<span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #0000dd;">printf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;<span style="color: #666666; font-weight: bold;">\n</span>Wie ich es vestanden habe bist du %i und deine Mutter ist  %i&quot;</span>, zahl1, zahl2<span style="color: #000000;">&#41;</span>;
getch<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #000000;">&#125;</span></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.jlip.de/c/einlesen-und-ausgeben-von-variablen-mit-scanf/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
	</channel>
</rss>
