Program to to read and display data of students using an array of pointers

#include<stdio.h>

    struct dob1
    {
        int date;
        int month;
        int year;
    }dob;

    struct student
    {
        int rno;
        char fname[80];
        char lname[80];
        int fees;
    } stud;

main()
{

    int n,i,j=0,k=0,l=0,m=0;
    int *p[100];
    char *q[1000];

    printf("Enter no. of students\n");
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        p[j]=stud.rno;
        p[j+1]=stud.fees;
        p[j+2]=dob.date;
        p[j+3]=dob.month;
        p[j+4]=dob.year;
        q[k]=&stud.fname[l];
        q[k+1]=&stud.lname[m];
        printf("Enter the first name of student no. %d\n",i+1);
        scanf("%s",q[k]);
        printf("Enter the last name of student no. %d\n",i+1);
        scanf("%s",q[k+1]);
        printf("Enter the roll no. of student no. %d\n",i+1);
        scanf("%d",&p[j]);
        printf("Enter the fees of student no. %d\n",i+1);
        scanf("%d",&p[j+1]);
        printf("Enter the date of birth [DD/MM/YYYY respectively] of student no. %d\n",i+1);
        scanf("%d",&p[j+2]);
        scanf("%d",&p[j+3]);
        scanf("%d",&p[j+4]);
        j=j+5;
        k=k+2;
        l=l+30;
        m=m+30;

    }
    j=0;
    k=0;
    printf("\n\n\nInformation of students are as follows:\n\n\n\n_______________________________________________\n\n\n");

    for(i=0;i<n;i++)
    {
        printf("Information of student no. %d\n",i+1);
        printf("Name of the student - %s %s\n",q[k],q[k+1]);
        printf("Roll no. of student - %d\n",p[j]);
        printf("Fees - %d\n",p[j+1]);
        printf("Date of birth - %d/%d/%d\n",p[j+2],p[j+3],p[j+4]);
        printf("\n\n\n_______________________________________________\n\n\n\n");
        l=l+30;
        m=m+30;
        j=j+5;
        k=k+2;

    }
}

Output:

21_3

Program to to calculate distance b/w two heights passing structure as pointers to the function

#include<stdio.h>
struct height1
{
    int a,b
} h1;
//int func(struct height1 *h1);
main()
{
    int diff;
    printf("Enter the two heights to get the difference b/w them.\n");
    scanf("%d",&h1.a);
    scanf("%d",&h1.b);

    diff = height(&h1);

}
int height(struct height1 *h1)
{
    if((*h1).a > (*h1).b)
    {

    printf("Difference of heights is %d",(*h1).a-(*h1).b);
    }
    else if((*h1).b > (*h1).a)
    {
         printf("Difference of heights is %d",(*h1).b-(*h1).a);
    }
    else if((*h1).a==(*h1).b)
    {
        printf("Difference of heights is 0");
    }

}

21_2