C program to accept student detail in structure and display it using pointer

Write a program to accept details of students into the structure and display roll number, name, marks in 3 subjects using pointer

int main()
{   int j;
    struct student{
        int rollno;
        char name[50];
        int marks[3];

    printf("Enter your rollno: ");
    scanf("%d", &ps->rollno);
    printf("Enter your name: ");
    scanf("%[^\n]", &ps->name);

    printf("Enter your marks: ");
    scanf("%d", &ps->marks[j]);}
    printf("\nRollNo: %d",ps->rollno);
    printf("\nName: %s",ps->name);

    printf("\nMarks: %d",ps->marks[j]);}
    return 0;


Enter your rollno: 38
Enter your name: gaurav prajapati
Enter your marks: 89 99 78

RollNo: 38
Name: gaurav prajapati
Marks: 89
Marks: 99
Marks: 78