netoops blog

Saturday, 24 August 2013

Abbriviation like N.S.Bose

#include<stdio.h>
#include<conio.h>
#include<string.h>

void main()
{
  char avv[10],ch,name[65];
  int loc,i,len;
  char *p;
  clrscr();
  printf("Enter ur name");
  gets(name);
  ch=name[0];
  printf("%c",ch);
  printf(".");
  len=strlen(name);
  for(i=1;i<len;i++)
  {
     ch=name[i];
     if(ch==' ')
     {
if(name[i+1] != ' ')
{
   printf("%c",name[i+1]);
   p=&name[i+1];
   printf(".");
}
else
{
   while(name[i] != ' ')
i++;
}
     }
  }
  printf("\b\b");
  puts(p);
  getch();
}

Tech Knowledege
SOCIALIZE IT →
FOLLOW US →
SHARE IT →

0 comments :

Post a Comment

 
Subscribe For Free Updates!

We'll not spam mate! We promise.

Become Our Fan on Social Sites!