delete Characters from a given position in a given string

To delete n Characters from a given position in a given string

/* Write a C program that uses functions to perform the following operations:
To delete n Characters from a given position in a given string.
*/
#include <stdio.h>
#include <conio.h>
#include <string.h>
void delchar(char *x,int a, int b);
void main()
{
char string[10];
int n,pos,p;
clrscr();
puts(“Enter the string”);
gets(string);
printf(“Enter the position from where to delete”);
scanf(“%d”,&pos);
printf(“Enter the number of characters to be deleted”);
scanf(“%d”,&n);
delchar(string, n,pos);
getch();
}
// Function to delete n characters
void delchar(char *x,int a, int b)
{
if ((a+b-1) <= strlen(x))
{
strcpy(&x[b-1],&x[a+b-1]);
puts(x);
}
}

8 comments:

  1. ID:201620318
    https://drive.google.com/open?id=0B2gcteJZycWoTEdjT0J0Q0RPRG8

    ReplyDelete
  2. 1)Delete Characters
    https://drive.google.com/open?id=0B5pG0kIjzgEKRDVsb0Fka2RFZFU

    ReplyDelete
  3. ID : 201620196
    https://www.dropbox.com/s/4ffr3298d8mvxwj/01.cpp?dl=0

    ReplyDelete
  4. ID 201610456
    link->
    https://drive.google.com/open?id=1r2GlG_70jwyZi7z3wAyyHsHvVApV9ScsijZ7jpERneE

    ReplyDelete
  5. ID 201610456
    different categories
    link->
    https://drive.google.com/open?id=0B_PIGnOMR0K2UTh4Vk14R085Uk0

    ReplyDelete
  6. ID: 201710494
    https://www.dropbox.com/s/906o49to6h5hhzf/1%20Multiple%20Inheritance.cpp?dl=0

    ReplyDelete
  7. ID: 201630243

    https://drive.google.com/open?id=0Byxq3aat_mNSXzZ0V2ptOWE4SFk

    ReplyDelete
  8. https://drive.google.com/open?id=0Byxq3aat_mNSXzZ0V2ptOWE4SFk

    ReplyDelete