Erster Commit

This commit is contained in:
2026-09-24 14:39:54 +02:00
commit dc05214087
245 changed files with 20517 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
#include <stdio.h>
#include <stdlib.h>
// --> FPa
// --> PPS
// A --> B
// distance [KM]
// speed [KM/H]
int main(void) {
float distance;
int speed;
float time;
int hours;
int minutes;
printf("Travel time calculator.\n");
printf("Distance: ");
scanf("%f",&distance);
printf("=> %.2f km\n", distance);
printf("Speed: ");
scanf("%d",&speed);
printf("=> %d km/h\n", speed);
time = distance / (float)speed;
printf("\nTime to go [dec]: %.2f\n", time);
hours = (int) time;
minutes = (time - hours) * 60;
printf("Drive time : %d h and %d min\n", hours, minutes);
return 0;
}