einlesen mehrerer Floats

This commit is contained in:
Stephan Richter
2018-02-09 13:57:05 +01:00
parent 399dffba9c
commit fab0845544

View File

@@ -1,10 +1,11 @@
#include <stdio.h> #include <stdio.h>
int main(){ int main(){
int alter; float a,b;
printf("Wie alt sind sie? "); printf("erste Zahl eingeben:");
scanf("%d", &alter); scanf("%f",&a);
printf("\nIn %d Jahren sind Sie 100!\n", 100-alter); printf("erste Zahl eingeben:");
scanf("%f",&b);
printf("die Summe aus %f und %f ist %.3f",a,b,a+b);
return 0; return 0;
} }