Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Enter n no. of element and delete value from desire position

Answer Posted / ruchi

#include<stdio.h>
#include<conio.h>
int main()
{
int n,pos,i,a[20];
printf("\nEnter how many elements are there in an array ");
scanf("%d",&n);
printf("\nEntert the elements ");
for(i=0;i<n;i++)
{

scanf("%d",&a[i]);
}
printf("\nEnter the position from where u want to delete
an item ");
scanf("%d",&pos);
pos=pos-1;
for(i=0;i<n;i++)
{
if((i==pos)&&(i!=n-1))
{
i=i+1;
}

if((i==pos)&&(i==n-1))
break;
printf("%d\n",a[i]);

}
getch();
}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the cout in c++?

1016


What are the sizes and ranges of the basic c++ data types?

1005


Should a constructor be public or private?

987


What is data abstraction? How is it different from data encapsulation?

956


Who calls main function?

1061


What is c++ prototype?

1098


What is null c++?

1080


Is set c++?

962


How compile and run c++ program in turbo c++?

1132


Why do we use pointers in c++?

988


What does std mean in c++?

1055


Describe Trees using C++ with an example.

1102


Write is a binary search tree? Write an algo and tell complexity?

985


why is iostream::eof inside a loop condition considered wrong?

1022


What is #include iostream in c++?

1017