Posts

Showing posts from December 15, 2019

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>...

ACP--- (UNIT--3) Linked list program 1

Linked list program 1 (UNIT-3) #include<stdio.h> #include<conio.h> #include<alloc.h> void create(void); void display(void); void inserta(void); void insertb(void); void insertc(void); void deletea(void); void deleteb(void); void deletec(void); struct list { int no; struct list *next; }*start,*list,*temp; void main() { int ans=10; clrscr(); while(ans!=9) { clrscr(); printf("\nEnter choice = "); printf("\n1. Create "); printf("\n2. Display"); printf("\n3. Insert @ start"); printf("\n4. Insert @ between"); printf("\n5. Insert @ end"); printf("\n6. Delete @ start"); printf("\n7. Delete @ between"); printf("\n8. Delete @ end"); printf("\n9. Exit "); printf("enter your choice = "); flushall(); scanf("%d",&ans); switch(ans) { case 1: create(); break; case 2: display(); b...