This is default featured post 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

Tampilkan postingan dengan label program menghitung luas Persegi Panjang. Tampilkan semua postingan
Tampilkan postingan dengan label program menghitung luas Persegi Panjang. Tampilkan semua postingan

Senin, 05 Maret 2012

program menghitung luas Persegi Panjang,Lingkaran ,Segitiga

#include <stdio.h>
#include <conio.h>
#include <stdlib.h>

int main () {
    char c='1';
    int p,l;
  
   while  (c!='5'){
    system("cls");
    printf("******************************\n");
    printf("********Menghitung Luas*******\n");
    printf("******************************\n");
    printf("*   1. Persegi Panjang        \n");
    printf("*   2. Persegi                \n");
    printf("*   3. Lingkaran              \n");
    printf("*   4. Segitiga               \n");
    printf("*   5. selesai                \n");
    printf("******************************\n");
    printf("*   Pilih Salah Satu! ");
    do{
        c= getch ();
        if(c>='1'&&c<='5') printf("%c",c);
    }
    while(c<'1'||c>'5');
    printf("      *\n");
    printf("******************************\n\n\n");
    switch(c){
        case '1': printf("Panjang : "); scanf("%d",&p);
                  printf("lebar   : "); scanf("%d",&l);
                  printf("Luas    : %d\n\n",p*l);
                  break;
        case '2': printf("Panjang sisi: "); scanf("%d",&p);
                  printf("Luas    : %d\n\n",p*p);
                  break;
        case '3': printf("Diameter: "); scanf("%d",&p);
                  printf("Luas    : %d\n\n",(float)22/7*p*p/4);
                  break;
        case '4': printf("Alas    : "); scanf("%d",&p);
                  printf("lTinggi : "); scanf("%d",&l);
                  printf("Luas    : %d",(float)p*l/2);
                  break;
             }
     getch();
    }
    printf("\n\n");
    system("pause");
    return(0);
}

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More