Alıştırma: Resimdeki Çıktıyı Veren Program

</p>
<p>#include &lt;stdio.h&gt;<br />
#include &lt;stdlib.h&gt;<br />
#include &lt;math.h&gt;</p>
<p>void boslukYaz(int);<br />
void yildizYaz(int);<br />
int main()<br />
{<br />
int n,i;<br />
printf(&quot;Elmasin bir kenari kac birim olsun?  &quot;);<br />
scanf(&quot;%i&quot;,&amp;n);<br />
for(i=1; i&lt;=2*n-1; i++){<br />
yildizYaz(fabs(n-i));<br />
boslukYaz(2*(n-fabs(n-i))-1);<br />
yildizYaz(fabs(n-i));<br />
printf(&quot;\n&quot;);<br />
}<br />
system(&quot;PAUSE&quot;);<br />
return 0;<br />
}</p>
<p>void boslukYaz(bosluk)<br />
{<br />
int i;<br />
for(i=0; i&lt;bosluk; i++)<br />
printf(&quot; &quot;);<br />
}</p>
<p>void yildizYaz(yildiz)<br />
{<br />
int i;<br />
for(i=0; i &lt; yildiz; i++)<br />
printf(&quot;*&quot;);</p>
<p>}</p>
<p>

Yorum Yapın

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Proudly powered by WordPress | Theme: Baskerville 2 by Anders Noren.

Up ↑

%d blogcu bunu beğendi: