help me run this program: a program that asks from the user the ff. data:
-full name
-address
-age
-birhtday
-course
-year level
*and store each user record in an array, prints the contents of the array in the order of occurence.
*the program must have at least two functions:
a.) input_data() - gets the info. from the user
b.) print)data() - prints the contents of all user records.
*don't use global variables
*have back up file can be in notepad or word.
SAMPLE RUN:
Enter record #1:
full name:____
address:_____
age:___
birthday:_____
course:______
year level:_____
Do you want to enter another record? (Y/N)
if No, record will be printed.
==============================================
this is what i make pls. i need ur suggestions and corrections:
Code:
#include <conio.h>
#include <stdio.h>
#define MAX 50
typedef struct
{
Char Name [70];
Char Address [100];
int age;
Char birthday [20];
Char course [10];
int year level;
} datatype
void input_data (datatype L [MAX]);
void print_data (datatype L [MAX]);
void main (void)
{
datatype L [MAX];
clrscr ();
input_data (L);
print_data (L);
getch ();
}
void input_data (datatype *L)
{
int i;
for (i = 0; i ,MAX; i#)
{
printf ("Input data for users %d\n", i + 1);
printf ("Name:");
gets (L [i].Name);
printf ("Address:");
gets (L [i].Address);
printf ("Age:");
gets (L [i].Age);
printf ("Birthday:");
gets (L [i].Birthday);
printf ("Course:");
gets (L [i].Course);
printf ("Year Level:");
gets (L [i].Year Level);
}
}
void print_data (datatype *L)
{
??????????????? don't know what to do next pls. heeeeeelp