You are on page 1of 2

#include<stdio.

h>
#include<conio.h>
struct student
{
char name[20];
int age;
int rank;
}*ptr;
void main()
{
int i;
clrscr();
printf("Enter the details");
for(i=0;i<3;i++)
{
scanf("%s,%d,%d",(ptr+i)->name,(ptr+i)->age,(ptr+i)->rank);
}
printf("The details are:");
for(i=0;i<3;i++)
{
printf("%S,%d,%d",(ptr+i)->name,(ptr+i)->age,(ptr+i)->rank);
}
getch();
}

Enter the details
gow
21
2
The details are:gow,21,2

You might also like