How to Delete element from array

  • How to Delete element from array


  • 1 Comment sorted by


  • #include
    #include
    main()
    {
    int data[10]={10,5,4,19,48,2,34,52};
    int x,n=8,loc;
    clrscr();
    printf("\nBefore deletion:\n");
    for(x=0;x {
    printf("%d,",data[x]);
    }
    printf("\nEnter location to delete:");
    scanf("%d",&loc);
    for(x=loc;x {
    data[x]=data[x+1];
    }
    n--;
    printf("\nAfter deletion:\n");
    for(x=0;x {
    printf("%d,",data[x]);
    }
    getch();
    }


Howdy, Stranger!

It looks like you're new here. If you want to get involved, or you want to Ask a new Question, Please Login or Create a new Account by Clicking below

Login with Facebook

Popular Posts of the Week

Top Posters Weekly

Optimum Creative