Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- void display(int b[],int k);
- void Edit_Array(int b[],int nn, int pp, int vv);
- int main()
- {
- int n,a[100],i,c,b=1,p,v;
- printf("\n How Many Values:\n");
- scanf("%d",&n);
- printf("\n Enter Values:\n");
- for(i=1;i<=n;i++)
- scanf("%d",&a[i]);
- while(b)
- {
- printf("\n---Menu---\n");
- printf("press 0 for Quiet\n");
- printf("press 1 for Display\n");
- printf("press 2 for insertion at last position\n");
- printf("press 3 for insertion at specific position\n");
- printf("press 4 for Deleting from specific position\n");
- printf("press 5 for Linear Search\n");
- printf("press 6 for Bouble Sort\n");
- printf("press 7 for Binary Search\n");
- printf("press 8 for Edit\n");
- printf("Enter Your Choice\n");
- scanf("%d",&c);
- switch(c)
- {
- case 0: b=0;
- break;
- case 1: printf("\n choice=Display\n");
- if (n!=0)
- Display(a,n);
- else
- printf("The Array is Empty\n");
- break;
- case 8: printf("\n choice= Edit\n");
- M: printf("Enter position Between %d to %d\n",1,n);
- scanf("%d",&p);
- if(p>=1 & p<=n)
- {
- printf("Enter Value\n");
- scanf("%d",&v);
- Edit_Array(a,n,p,v);
- }
- else
- {
- printf("\n Wrong Position\n");
- goto M;
- }
- break;
- default:printf("\n Wrong Choice\n");
- break;
- }
- }
- }
- void Display(int b[],int k)
- {
- int j;
- printf("\n The values Are\n");
- for (j=1;j<=k;j++)
- printf ("%d\n",b[j]);
- }
- void Edit_Array(int b[], int nn,int pp,int vv)
- {
- b[pp]=vv;
- }
Add Comment
Please, Sign In to add comment