Zeitfunktionen

This commit is contained in:
Stephan Richter
2018-02-09 15:07:42 +01:00
parent e66a1535bf
commit fd0c6f6994
2 changed files with 12 additions and 2 deletions

View File

@@ -2,6 +2,9 @@
#define FUNKTIONEN_H
#include<time.h>
int mult(int a, int b) {
return a * b;
}
@@ -10,4 +13,12 @@ int add(int a, int b) {
return a + b;
}
void printTime(){
time_t now;
time(&now);
struct tm *myTm;
myTm = localtime(&now);
printf("%02d:%02d:%02d Uhr\n", myTm->tm_hour, myTm->tm_min, myTm->tm_sec);
}
#endif

View File

@@ -2,7 +2,6 @@
#include "funktionen.h"
int main() {
printf("Produkt: %d\n", mult(4, 5));
printf("Summe: %d\n", add(4, 5));
printTime();
return 0;
}