einlesen mehrerer Floats
This commit is contained in:
11
src/main.c
11
src/main.c
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user