Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/articles/c-tutorials/)
-   -   Friendship Calculator With Poll (http://www.go4expert.com/articles/friendship-calculator-poll-t1176/)

TEJUS 12Aug2006 16:10

Friendship Calculator With Poll
 
1 Attachment(s)
====================
.FRIENDSHIP CALCULATOR.
====================
Code: C

#include<stdio.h>
#include<string.h>
#include<conio.h>
main()
{
    clrscr();
    char name[20],n[20];
    char *pointer;
    int a,b;
    printf("\n NAME: ");
    gets(name);
    printf("\n FRIEND's NAME: ");
    gets(n);
    b=0;
    for(a=1;n[a]!='\0';a++)
    {
        pointer=strchr(name,n[a]);
        if(pointer)
        {
            b=b+1;
        }
    }
    b=b*25;
    if(b>=100)
    {
        printf("\n %s AND %s ARE 100% TRUE FRIEND'S."name,n);
    }
    else
    {
        printf("\n %s AND %s ARE %d% TRUE FRIEND'S."name,n,b);
    }
    getch();
    return 0;
}


rahul.mca2001 6Mar2008 13:34

Re: Friendship Calculator With Poll
 
nice yaar

asadullah.ansari 6Mar2008 13:39

Re: Friendship Calculator With Poll
 
Good things ...Just Keep it and post more articles Tejus.

rikk_awal 9Jun2009 11:36

Re: Friendship Calculator With Poll
 
its cool yaar

cindrilla 15Nov2010 21:50

Re: Friendship Calculator With Poll
 
ya very 5n

saahra 16Nov2010 14:58

Re: Friendship Calculator With Poll
 
hey its gud..but can u explain me d logic plzz..!!


All times are GMT +5.5. The time now is 09:39.