Last active
October 30, 2020 15:56
-
-
Save tofikhidayatxyz/10a93d2cc3ec8417054ac45d79e4ac0c to your computer and use it in GitHub Desktop.
Menghitung berat benih jagung bersarkan luas lahan
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| int main(int argc, const char * argv[]) { | |
| float beratBenih = .15; // as gram | |
| int lebar = 3; // as meter | |
| int panjang = 4; // as meter | |
| // lebar di kurang (jarak 1 meter di kali 2) (jarak pingir) | |
| int lebarTotal = lebar - 2; | |
| // panjag di kurang (jarak 1 meter di kali 2) (jarak pingir) | |
| int panjangTotal = panjang - 2; | |
| // menghitung titik benih | |
| int totalTitik =((lebarTotal / .5) + 1) * ((panjangTotal / .5) + 1); | |
| // menghitung total benih yang di perlukan | |
| int totalBenih = totalTitik * 2; | |
| // menhitung total berat benih | |
| float beratTotalBenih = beratBenih * totalBenih; | |
| printf("Berat total benih adalah : %.2f\n Gram", beratTotalBenih); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment