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
Explain how to reverse singly link list.
Explain what happens if you free a pointer twice?
What is variables in c?
What are the properties of union in c?
in multiple branching construct "default" case is a) optional b) compulsarily c) it is not include in this construct d) none of the above
How can you draw circles in C?
Is null always defined as 0(zero)?
what is a constant pointer in C
What is advantage of pointer in c?
Why is c called c not d or e?
What is the difference between memcpy and memmove?
How is a structure member accessed?
please send me the code for multiplying sparse matrix using c
What does == mean in texting?
Function calling procedures? and their differences? Why should one go for Call by Reference?