Zeitfunktionen
This commit is contained in:
@@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
#define FUNKTIONEN_H
|
#define FUNKTIONEN_H
|
||||||
|
|
||||||
|
#include<time.h>
|
||||||
|
|
||||||
|
|
||||||
int mult(int a, int b) {
|
int mult(int a, int b) {
|
||||||
return a * b;
|
return a * b;
|
||||||
}
|
}
|
||||||
@@ -10,4 +13,12 @@ int add(int a, int b) {
|
|||||||
return a + 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
|
#endif
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
#include "funktionen.h"
|
#include "funktionen.h"
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
printf("Produkt: %d\n", mult(4, 5));
|
printTime();
|
||||||
printf("Summe: %d\n", add(4, 5));
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user