Ex 4

  • October 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Ex 4 as PDF for free.

More details

  • Words: 198
  • Pages: 3
EX.NO:4

ARRAY IMPLEMENTATION - LIST

PROGRAM #include<stdio.h> #include #include<string.h> static int n=0; const int MAX=50; void disp(); struct list { int no; char name[30]; }l1[50]; void create() { int n,i; for(i=0;i<20;i++) { l1[i].no=0; strcpy(l1[i].name," " ); } } void add() { if(n!=50) { printf("Enter the number:"); scanf("%d",&l1[n].no); printf("Enter the name:"); scanf("%s",l1[n].name); n=n+1; } else printf("The list is full"); disp(); } void del() { int num,i,j,x; printf("Enter the number to be deleted:"); scanf("%d",&num); for(i=0;i
{ l1[i].no=0; strcpy(l1[i].name," "); for(j=i;j
void main() { int ch; char c='y'; clrscr(); create(); do { printf("1.add\t 2.delete\t 3.modify\t 4.display\n"); printf("Enter your choice:"); scanf("%d",&ch); switch(ch) { case 1: add(); break; case 2: del(); break; case 3: modi(); break; case 4: disp(); break; default: printf("Enter the correct choice:"); break; } printf("Do you want to continue?(y/n):"); c=getch(); } while(c=='y'); getch(); }

Related Documents

Ex-4
April 2020 13
Ex 4
April 2020 14
Ex 4
November 2019 17
Ex 4
October 2019 16
Ex 4
October 2019 18
Ex 4 4 Fsc Part1
July 2020 10