Hi my name is jitesh and i'am new in c programing. I wrote this piece of code it's ment to take in information from the user about a car and display it back on the screen after the code is excuted but unfourtunately i can'nt make it do that and i have tried everything and nothing worked. I will be highly greatful if you can help in in any way.
#include<stdio.h>
typedef struct{
char make[10], model[10];
int odometer;
}car_t;
int getCar(car_t *c);
void showCar(car_t c);
int
main(void)
{
char model;
char make;
int odometer;
printf("Who made the car\n");
scanf("The car is of type %s made %s in and has odoometeder %d of.\n",model, make, odometer);
getCar(car_t *c);
return(0);
}
int
getCar(car_t *c)
{
int status;
status = scanf("%s%s%", &c->make, &c->model);
if (status == 2)
status = 1;
else if (status !=2)
status = 0;
status = scanf("%d", &c->odometer);
if (status == 1)
status = 1;
else if (status !=EOF)
status = 0;
return(status);
}
void
showCar(car_t c)
{
char a, b;
int d;
a = c.make;
b = c.model;
d= c.odometer;
printf("Enter the name of the car.\n");
scanf("%s", a);
printf("Enter the model of the car.\n");
scanf("%s", b);
printf("Enter the odometer reading of the car.\n");
scanf("%d", c);
}