Total Pageviews

ARRAY

PROGRAM OF DELETION FROM ARRAY 

 #include<stdio.h>
 #include<conio.h>
 void main()
 {
 int a[100],n,loc,p,i,num;
 clrscr();
 printf("\n\nEnter the size of list\t:");
 scanf("%d",&n);
 printf("\n\nEnter the elements of list\t");
 for(i=0;i<n;i++)
 {
 scanf("%d",&a[i]);
 }
 printf("\n\n\2Your list");
 for(i=0;i<n;i++)
 {
 printf("\t%d",a[i]);
 }
  printf("\nif you want delete a number from the list \n Inseart the location");
  scanf("%d",&loc);
  if(loc>n)
  {
  printf("You enterd a rong choice\t\2");
  }
  else
  {
  loc=loc-1;
  while(n>loc)
  {
   a[loc]=a[loc+1];
   loc=loc+1;
  }
  n=n-1;
  printf("\nAfter deletion your list:\n");
  for(i=0;i<n;i++)
  {
  printf("\t%d",a[i]);
  }
  }
  getch();
  }





 

SEND FREE SMS ALL OVER WORLD AND EARN MONEY FOR YOUR MOBILE RECHARGE CLICK HERE...

IF YOU WANT EARN Rs.9,000PM WITHOUT ANY WORK  ....CLICK HERE

No comments:

Post a Comment