erste Strings
This commit is contained in:
10
src/main.c
10
src/main.c
@@ -1,11 +1,9 @@
|
|||||||
#include<stdio.h>
|
#include<stdio.h>
|
||||||
|
#include<string.h>
|
||||||
// Symbolische Konstante
|
|
||||||
#define MWSTFAKTOR 0.19
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
float betrag = 350.0;
|
char string[] = "Die schoenen Dinge im Leben sind umsonst.";
|
||||||
float mwst = betrag * MWSTFAKTOR;
|
int laenge = strlen(string);
|
||||||
printf("%.f% von %.2f Euro: %.2f Euro\n", MWSTFAKTOR * 100, betrag, mwst);
|
printf("Laenge: %d Zeichen\n", laenge);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user