Inserting String C Program Tamil


#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
   int i,p,c=0,k=0,j,n;
   char *a,*b,*s;
   clrscr();
   printf("\nEnter the string:");
   gets(a);
   printf("\nEnter the position :");
   scanf("%d",&p);
   fflush(stdio);
   printf("\nEnter the new string :");
   gets(s);
   n=strlen(s);
   for(i=0;i<p-1;i++)
   {
     b[i]=a[i];
     c++;
   }
   for(i=0;s[i]!='\0';i++)
   {
     b[i+c]=s[i];
     k++;
   }
   for(i=0;a[i]!='\0';i++)
   {
     b[i+k+c]=a[i];
   }
   b[i+c+k]='\0';
   puts(b);
   getch();
}

Login To Download Source Code

Leave a Comment:

Login To Comment

List Of Programs


Goto Examples

Operators

Looping

Number Conversion

Pattern Design

Arrays

Matrix Examples

Sorting Examples

String Function

Change Case

String In C

Maths Functions

User Defined Functions

Recursive Functions

Pointer

Structure

File Concept

Calender Programming