#include<stdio.h>
#include<conio.h>
struct person
{
char name[10];
int age;
};
void main()
{
struct person p;
clrscr();
printf("Enter name of Person\n");
scanf("%s",p.name);
printf("Enter age of Person\n");
scanf("%d",&p.age);
printf("Name=%s\n",p.name);
printf("Age=%d\n",p.age);
getch();
}
OUTPUT:

#include<conio.h>
struct person
{
char name[10];
int age;
};
void main()
{
struct person p;
clrscr();
printf("Enter name of Person\n");
scanf("%s",p.name);
printf("Enter age of Person\n");
scanf("%d",&p.age);
printf("Name=%s\n",p.name);
printf("Age=%d\n",p.age);
getch();
}
OUTPUT:
Enter name of Person
Tushar
Enter age of Person
18
Name=Tushar
Age=18
No comments:
Post a Comment