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 / koshy

#include "stdio.h"
main()
{
char str="hello world";
char i,j,a,b,len;

len=((const char *)str);
printf("char to be inserted:");
scanf("%d",&a);

printf("at position");
scanf("%d",&b);

for(i=0;i<len;i++)
{
temp=str[b];
str[b]=a;
str[b+1]=temp;
for(j=b+1;(j<len) &&(str[j]!=0);j++)
{
str[j+1]=str[j];
}

}






}

Is This Answer Correct ?    19 Yes 14 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you redirect a standard stream?

1050


What is hash table in c?

972


code for find determinent of amatrix

1917


Is c pass by value or reference?

996


#include main() { int *p, *c, i; i = 5; p = (int*) (malloc(sizeof(i))); printf(" %d",*p); *p = 10; printf(" %d %d",i,*p); c = (int*) calloc(2); printf(" %d ",*c); }

1003


Are global variables static in c?

1108


What is structure in c definition?

984


When should volatile modifier be used?

954


What is memcpy() function?

1047


How can I do peek and poke in c?

1038


What is the use of printf() and scanf() functions?

1069


Is null always defined as 0(zero)?

1042


Is c object oriented?

911


Write a program to generate the Fibinocci Series

1162


What is void main ()?

1012