Basic C Programming help!
Hello, I just started to learn the C language.
I want to make a simple rental program that requests a user to input the time and day, and displays the duration that something was rented out for.. like a program for a library, or a car company.
Really confused on how to save/display time and date... do I use time.h? Thanks in advance
Code:
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
int main(void)
{
char rentdate, returned;
char rentTime, returnedTime;
int totalTime;
int cost;
printf("Please enter the date the bike is rented out.(MM/DD/YY):\n");
scanf("%s", &rentdate);
printf("Please enter the time the bike is rented out.(HH:MM):\n");
scanf("%s", &rentTime);
printf("Please enter the date the bike was returned.(MM/DD/YY):\n");
scanf("%s", &returned);
printf("Please enter the time the bike is returned out (HH:MM):\n");
scanf("%s", &returnedTime);
totalTime =
getch();
}