Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int volumen (int x, int y, int z) {
- return x*y*z;
- }
- int oberflaeche(int x, int y, int z) {
- return (2*x*y)+(2*x*z)+(2*y*z);
- }
- int main(int argc, char *argv[]) {
- int a, b, c, s;
- printf("a = ");
- scanf("%d", &a);
- printf("b = ");
- scanf("%d", &b);
- printf("c = ");
- scanf("%d", &c);
- printf("(1) Volumen \n");
- printf("(2) Oberflaeche \n");
- printf("Auswahl (1-2): ");
- scanf("%d", &s);
- if (s == 1) {
- printf("Volumen: %d m^3", volumen(a,b,c));
- }
- else if (s == 2) {
- printf("Oberflaeche: %d qm", oberflaeche(a,b,c));
- }
- else {
- printf("Fehlerhafte Eingabe!");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement