/* The program can convert an extended term into its abbreviation.
eg -> Central Processing Unit : C P U
World Wide Web : W W W */
#include<string.h>
void main()
{
char text[40], abbre[10];
int i;
cout<<"\n Enter the String (extended term):";
gets(text);
for( i = 0; text[i] ! = '\0' ; i++)
if(text[i] = = ' ' )
{ strcpy(abbre, str[i+1]);
strcpy(abbre, " ");
}
cout<< text << " can be abbreviated into " << abbre;
getch();
}
eg -> Central Processing Unit : C P U
World Wide Web : W W W */
#include <iostream.h>
#include <conio.h>
#include<stdio.h>#include<string.h>
void main()
{
char text[40], abbre[10];
int i;
cout<<"\n Enter the String (extended term):";
gets(text);
for( i = 0; text[i] ! = '\0' ; i++)
if(text[i] = = ' ' )
{ strcpy(abbre, str[i+1]);
strcpy(abbre, " ");
}
cout<< text << " can be abbreviated into " << abbre;
getch();
}
No comments:
Post a Comment