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

Which should be more useful: the protected and public virtuals?

975


What is a storage class?

1175


Explain about Virtual Function in C++?

972


Explain mutable storage class specifier.

1028


What is the basic structure of a c++ program?

1075


Explain data encapsulation?

1061


What does n mean in c++?

1070


What are multiple inheritances (virtual inheritance)?

1020


Can we use struct in c++?

965


What are pointers, when declared, intialized to a) NULL b) Newly allocated memory c) Nothing. Its random

1070


What do the keywords volatile and mean mutable?

1004


daily Routine of father

1351


How do you print a string on the printer?

988


What is a wchar_t in c++?

1058


Why pointer is used in c++?

1080