Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Dasprog C - 2019
- William Handi Wijaya
- 0087
- Program untuk menghitung luas segitiga.
- */
- #include <stdio.h>
- int getInput();
- int keliling(int n);
- double luas(int n);
- int main(void)
- {
- // Masukkan input
- int n = getInput();
- // Print luas;
- printf("Luas: %lf\n", luas(n));
- return 0;
- }
- int getInput()
- {
- int n;
- scanf("%d", &n);
- return n;
- }
- double luas(int n)
- {
- return (0.5 * (double) n * n);
- }
Advertisement
Add Comment
Please, Sign In to add comment