Answers for "deleting a word with copy fuction c code"

C
0

deleting a word with copy fuction c code

#include<stdio.h>
  2 void my_strcpy(char*,char*);
  3 void main()
  4 {
  5 int i;
  6 char s[10],d[10],ch;
  7 printf("Enter the source string...\n");
  8 scanf("%s",s);
  9 printf("Enter the charcter.....\n");
 10 scanf(" %c",&ch);
 11
 12 for(i=0;s[i]!=0;i++)
 13 {
 14         if(s[i]==ch)
 15         {       my_strcpy(s+i+1,s+i);
 16                 i--;
 17         }
 18
 19
 20 }
 21
 22
 23 printf("after the deleting s=%s",s);
 24 }
 25 void my_strcpy(char*s,char*d)
 26 {
 27 int i;
 28 for(i=0;s[i]!='\0';i++)
 29    d[i]=s[i];
 30  d[i]='\0';
 31 }
~
Posted by: Guest on September-16-2021

Code answers related to "C"

Browse Popular Code Answers by Language