-
Notifications
You must be signed in to change notification settings - Fork 0
/
QuaderBerechner.c
39 lines (36 loc) · 1.33 KB
/
QuaderBerechner.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*------------------------------------------------------------------------------
* HTBLA-Leonding / Class: 3ACIF
*------------------------------------------------------------------------------
* Jan Ritt
*------------------------------------------------------------------------------
* Description: Program to calculate the volume and base of a quader.
*----------------------------------------------------------------------------*/
#include <stdio.h>
int main(void)
{
int lenght;
int width;
int height;
int base;
int coat;
int volume;
printf("\n Quarderberechner");
printf("\n ================");
printf("\nGeben Sie die Laenge Ihres Quaders ein.");
scanf("%d",&lenght);
printf("Geben Sie die Breite Ihres Quaders ein.");
scanf("%d",&width);
printf("Geben Sie die Hoehe Ihres Quaders ein.");
scanf("%d",&height);
printf(" ----------------");
base = lenght * width;
printf("\nDie Grundflaeche ihres Quaders ist %d.",base);
coat = (2*(width+lenght))*height;
printf("\nDer Mantel ihres Quaders ist %d.",coat);
volume = lenght * width * height;
printf("\nDas Volumen ihres Quaders ist %d.",volume);
printf("\n ----------------");
while (getchar() != '\n');
getchar();
return 0;
}