Friday, June 20, 2014

Get Abbreviation

Get abbreviation of a given name entered by user in C Programming language by Project Free TV . 

#include<stdio.h>
void header()
{
    printf("\n\n\n\n\n\n\n\t\tBUILT AND DESIGNED BY >> ARSLAN UD DIN SHAFIQ\n\n\t\tWebsite>>\twww.CWorldbyAS.blogspot.com\n");
    printf("\n\t\tCOMSATS Institute of Information Technology,\n\n\t\t\t\t\t  Lahore , Pakistan\n\n\n");
}
int main()
{
    char name[100];
    int i=0;
    header();
    system("pause");
    system("cls");
    printf("Enter Name : ");
    gets(name);
    system("cls");
    printf("You have entered %s ",name);
    printf("\n\n\n\t\tAbbreviation");
    printf("\n\n\t\t     %c",name[i]);
    for(i=0;name[i]!='\0';i++)
    {
        if (name[i]==' ')
        {
            i++;
            printf("%c",name[i]);

        }
    }
printf("\n\n\n\n");
}

No comments:

Post a Comment