Programs to be practiced in the Lab

Programs to be practiced in the Lab. These programs will help u in your theory and practical exams. A) Write a C program to swap m and n element of single linked list. #include<stdio.h> #include<conio.h> struct list { int data; struct list *link; }*start=NULL; void creat(int); void swap(); void disp(); void main() { int ch,i,n,m; clrscr(); do { printf(“\n1.create”); printf(“\n2.display”); printf(“\n3.Swap”); printf(“\n4.exit”); printf(“\nenter ur choice”); scanf(“%d”,&ch); switch(ch) { case 1: printf(“\nHow many nodes”); scanf(“%d”,&n); for(i=0;i<n;i++) { printf(“\nEnter the data”); scanf(“%d”,&m); creat(m); } break; case 2: disp(); break; case 4: exit(0); case 3: swap(); break; } } while(ch!=4); getch(); } void creat(int m) { struct list *tmp,*q; tmp=(struct list *)malloc(sizeof(struct list)); tmp->data=m; tmp->link=NULL; if(start==NULL) start=tmp; else { q=start; while(q->link!...