Simple Structure

Thursday, 8 September 2011

#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:


Enter name of Person
Tushar
Enter age of Person
18
Name=Tushar
Age=18








No comments:

Post a Comment

 

Blogger news

Blogroll

Enter your email address:

Delivered by FeedBurner

Total Pageviews

Followers

Most Reading