#include <stdio.h>
void main()
{
struct state{
char name[30];
int district;
int popln;
}state={"",0,0};
clrscr();
printf("\nEnter state name : ");
flushall();
gets(state.name);
printf("Enter no. of districts : ");
flushall();
scanf("%d",&state.district);
printf("Enter population : ");
flushall();
scanf("%d",&state.popln);
clrscr();
printf("STATE\n-----\nName\t\t : %s\nDistricts"
"\t : %d\nPopulation\t : %d",state.name,state.district,state.popln);
getch();
}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.