Deleting Words In C Program Tamil


#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
    int i,n,s,k=0,l=0;
    char *a,*b,c[100][100];
    clrscr();
    printf("\nENter the string :");
    gets(a);
    printf("\nnumber of word to deleted :");
    scanf("%d",&s);
    n=strlen(a);
    a[n]=' ';
    for(i=0;i<=n;i++)
    {
       if(a[i]!=32)
       {
	 b[k]=a[i];
	 k++;
       }
       else
       {
	  b[k]='\0';
	  strcpy(c[l],b);
	  l++;
	  k=0;
       }
    }
     for(i=0;i<=s;i++)
     {
	strcpy(c[l-i],"");
     }
     for(i=0;i<l;i++)
     {
       printf("%s",c[i]);
       printf(" ");
     }
     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