//Calculate age of student at admission time
#include <stdio.h>
#include<string.h>
#include<math.h>

int age(int,int);

struct student{
 int p;
 char str[10];
 int a;
 int b;

};


void main(){
    int g=0;
    printf("\t\tENTER STUDENT DETAIL\n ");
    int c,d;
    printf("ENTER TOTAL NUMBER OF students =\n\n");
    scanf("%d",&c);
    struct student arr[c];
    for(int i=0;i<c;i++){
        scanf("%d",&arr[i].p);
        scanf("%s",&arr[i].str[0]);
        scanf("%d",&arr[i].a);
        scanf("%d",&arr[i].b);
    }
  for(int i=0;i<c;i++){
      printf("ENTER ROLL NO' = %d\n",arr[i].p);
      printf("ENTER NAME = %s\n",arr[i].str);
      printf("ENTER Birth Year = %d\n",arr[i].a);
      printf("ENTER Admission year  = %d\n",arr[i].b);
      printf("\n");
        g=age(arr[i].a,arr[i].b);
      printf("APPROXIMATE AGE OF STUDENT  = %d\n\n",g);

        }
}
 int age(int x , int y){
         int t;
         t=y-x;
         return(t);
        
    } 

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: