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
What is optimization in c?
What does the && operator do in a program code?
What is the purpose of & in scanf?
write a c program to print the next of a particular no without using the arithmetic operator or looping statements?
Who developed c language?
#include main() { enum _tag{ left=10, right, front=100, back}; printf("left is %d, right is %d, front is %d, back is %d",left,right,front,back); }
What are the disadvantages of c language?
What standard functions are available to manipulate strings?
What is the default value of local and global variables in c?
What is the significance of c program algorithms?
write a programe to accept any two number and check the following condition using goto state ment.if a>b,print a & find whether it is even or odd and then print.and a
write a program to find the given number is prime or not
Tell me when is a void pointer used?
What is a pragma?
c language interview questions & answer