1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Friendship Calculator With Poll

Discussion in 'C' started by TEJUS, Aug 12, 2006.

?

DID U LIKE IT ?

  1. YA,VERY VERY GOOD

    50.0%
  2. SEEMS GOOD

    36.4%
  3. NOT AT ALL.

    9.1%
  4. VERY BAD.

    4.5%
  1. TEJUS

    TEJUS New Member

    Joined:
    Aug 6, 2006
    Messages:
    11
    Likes Received:
    1
    Trophy Points:
    0
    Occupation:
    STUDENT
    Location:
    IN KERALA,KOLLAM
    ====================
    .FRIENDSHIP CALCULATOR.
    ====================
    Code:
    #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;
    }
     

    Attached Files:

    saurabh vora likes this.
  2. rahul.mca2001

    rahul.mca2001 New Member

    Joined:
    Feb 13, 2008
    Messages:
    103
    Likes Received:
    0
    Trophy Points:
    0
  3. asadullah.ansari

    asadullah.ansari TechCake

    Joined:
    Jan 9, 2008
    Messages:
    356
    Likes Received:
    14
    Trophy Points:
    0
    Occupation:
    Developer
    Location:
    NOIDA
    Good things ...Just Keep it and post more articles Tejus.
     
  4. rikk_awal

    rikk_awal New Member

    Joined:
    Mar 21, 2009
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    its cool yaar
     
  5. cindrilla

    cindrilla New Member

    Joined:
    Sep 26, 2010
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    student
    Location:
    hyderabad
  6. saahra

    saahra New Member

    Joined:
    Nov 16, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    hey its gud..but can u explain me d logic plzz..!!
     

Share This Page