Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Dasproc C - 2019
- William Handi Wijaya
- 0087
- Program untuk menghitung luas persegi.
- */
- #include<stdio.h>
- int main(){
- printf("------Calculates The Area of A Square------ \n\n\n");
- // Deklarasi variabel sisi dan luas yang akan digunakan pada program
- float sisi,
- luas;
- // Masukkan nilai sisi dari persegi
- printf("Insert the leght of one side in cm => ");
- scanf("%f", &sisi);
- // Hitung luas dari persegi menggunakan data yang telah diberikan
- luas = sisi * sisi;
- // Tampilkan nilai sisi dari luas yang telah dihitung ke monitor
- printf(" The area of a square whose side length is %0.2f cm is %0.2f square cm. \n\n", sisi, luas);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment