From 05baeedb4650c77f20b80aa40bcd516753af84bc Mon Sep 17 00:00:00 2001 From: mirfa <84218249+mirfa695@users.noreply.github.com> Date: Wed, 12 Oct 2022 14:51:42 +0530 Subject: [PATCH] Create shortform.c --- shortform.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 shortform.c diff --git a/shortform.c b/shortform.c new file mode 100644 index 00000000..1dd39bbf --- /dev/null +++ b/shortform.c @@ -0,0 +1,23 @@ +#include +#include + +void main() +{ + char str[80],c,ss[10]; + int i,j,in=0; + clrscr(); + printf("Enter a string : "); + gets(str); + for(i=0,j=0;(c=str[i])!='\0';i++) + { + if(c<'A' || c>'Z'&&c<'a' || c>'z') in=0; + else if(!in) + { + in=1; + ss[j++]=c; + } + } + ss[j]='\0'; + printf("\nShort form is %s",ss); + getch(); +}