#include<stdio.h>
struct Person
{
char name[20];
int age;
};
main()
{
struct Person p;
clrscr();
//accept data
printf("Enter name of the person:");
scanf("%s",p.name);
printf("Enter age of the person:");
scanf("%d",&p.age);
//Display data
printf("Name of the person : %s\n",p.name);
printf("Age of the person : %d",p.age);
getch();
}
0 Comments