i'm new to this c programming. all i wanna do is to make the user to enter the number of student, then input the name and address of the student. later i want it to print the name and the address. the program crashes after i input all the name and the address.
i don't know whether this program is wrong or my pc problem. thank you :) oh btw, i need to use array for this program.
#include <stdio.h>
#include <conio.h>
void main ()
{
int i, n;
char name[30][30];
char add[30][30];
printf ("Enter the number of student >> ");
scanf ("%d", &n);
for (i = 0;i < n; i++)
{
printf ("Enter the name of student %d >> ", i+1);
scanf ("%s", &name[i][30]);
printf ("Enter the address of student %d >> ", i+1);
scanf ("%s", &add[i][30]);
}
for (i = 0; i < n; i++)
{
printf ("The name of student %d is >> %s", i+1, name[i][30]);
printf ("The address of student %d >> %s", i+1, add[i][30]);
}
printf ("\n");
}