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...

write a program to insert an element at the specified
position in the given array in c language

Answer Posted / ashok kannan

Hi to all,

/* program to insert element in the array at given
position*/
#include<stdio.h>
#include<conio.h>
void main()
{
char c,t2,t1,a[100]="This is c program";
int n,i;

printf("Enter the position and the element\n");
scanf("%d%c",&n,c);

for(i=n,t1=a[i];a[i]!='\0';i++)
{
t2=a[i+1];
a[i+1]=t1;
t1=t2;
}
a[n]=c;

printf("%s",a);
getch();

}

Is This Answer Correct ?    19 Yes 46 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how to reverse singly link list.

1200


Explain what happens if you free a pointer twice?

1134


What is variables in c?

1091


What are the properties of union in c?

1108


in multiple branching construct "default" case is a) optional b) compulsarily c) it is not include in this construct d) none of the above

1116


How can you draw circles in C?

1195


Is null always defined as 0(zero)?

1174


what is a constant pointer in C

1243


What is advantage of pointer in c?

1243


Why is c called c not d or e?

1140


What is the difference between memcpy and memmove?

1082


How is a structure member accessed?

1185


please send me the code for multiplying sparse matrix using c

2219


What does == mean in texting?

1388


Function calling procedures? and their differences? Why should one go for Call by Reference?

1130