I made a progam to calculate the surface of a cirkel. But when i open it, and a give the dia meter and press enter, the progam close. This is the code;
(don't look at the dutch words)Code:#include <stdio.h> #define PI 3.14 int main() { int diameter; double straal; double oppervlakte; printf("Geef de diameter van de cirkel:\t"); scanf("%d", &diameter); straal = diameter / 2; oppervlakte = PI * (straal * straal); printf(" De oppervlakte is \t%d", oppervlakte); return 0; }
Do you know a solution?