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 constructor and destructor in c++?

1170


What is the identity function in c++? How is it useful?

1098


What are special characters c++?

1086


What are the advantages of prototyping?

1128


What is endianness?

1152


How many keywords are used in c++?

1063


Which software is best for c++ programming?

1091


What do you understand by pure virtual function? Write about its use?

1045


Describe the syntax of single inheritance in C++?

1120


Define private, protected and public access control.

1167


What is the difference between a type-specific template friend class and a general template friend class?

1032


Function can be overloaded based on the parameter which is a value or a reference. Explain if the statement is true.

1169


What is prototype for that c string function?

1193


Why is it called c++?

1086


How will you call C functions from C ++ and vice-versa?

1192