Ujian

#include <stdio.h>
#include <conio.h>
main()
{
int pil,rl,rs,ts,t,f,r,e,s,h;
float phi,ll,ls;
phi = 3.14;
clrscr();
printf (“**** _-MENU-_ ****\n”);
printf (“1. Luas Lingkaran \n”);
printf (“2. Luas Silinder  \n”);
printf (“3. Deret 1        \n”);
printf (“4. Deret 2        \n”);
printf (“5. Deret 3        \n”);
printf (“Masukkan Pilihan:   “);
scanf (“%d”, &pil);
switch (pil)
{
case 1 :
clrscr();
printf (“\n input jari2 lingkaran: “);
scanf (“%d”, &rl);
ll=phi*rl*rl;
printf (“\n luas lingkaran= %.2f”,ll);
break;
case 2 :
clrscr();
printf (“\n input jari2 : “);
scanf (“%d”, &rs);
printf (“\n input tinggi : “);
scanf (“%d”, &ts);
ls=phi*rs*ts;
printf (“\n luas silinder= %.2f”,ls);
break;
case 3 :
clrscr();
printf (“input : “);
scanf (“%d”, &f);
for (r=f;r>=1;r–)
{
printf (“\n”);
for (e=1;e<=r;e++)
{
printf (“%d”,e);
}
}
break;
case 4 :
clrscr();
printf (“input : “);
scanf (“%d”, &f);
for (r=f;r>=1;r–)
{
printf (“\n”);
for (e=1;e<=r;e++)
{
printf (“%d”,e);
}
}
break;
case 5 :
clrscr();
printf (“input : “);
scanf (“%d”, &f);
for (r=1;r<=f;r++)
{
printf (“\n”);
for (e=1;e<=r;e++)
{
printf (“%d”,e);
}
}
f=f-1;
for (s=f;s>=1;s–)
{
printf (“\n”);
for (h=1;h<=s;h++)
{
printf (“%d”,h);
}
}
break;
Default:
clrscr();
printf (“\n byeee….”);
}
getch();
}

 

SS:

 

 

 

 

 

 

Lebih baik Download aja biar gak ada masalah:

Download

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: