ACP UNIT-1 programs + files
UNIT---1 1) Write a program to define structure with tag state with fields state name, number of districts and total population. Read and display the data. ANS) #include<stdio.h> #include<conio.h> void main() { struct state { char nam[20]; long int dis,pop; }state; clrscr(); printf("Enter Your state name = "); gets(state.nam); printf("Enter no of districts = "); scanf("%d",&state.dis); printf("Enter total population = "); scanf("%ld",&state.pop); printf("\n\nState name = %s",state.nam); printf("\n\nTotal District = %d",state.dis); printf("\n\nPopulation = %ld",state.pop); getch(); } 2) Write a program to create a list of books details. The details of a book include title, author, publisher, publishing year, number of pages, and price. ASN) #include<stdio.h> #include<conio.h>...