C Examples

Welcome to C Examples section of our website. Here you will find a list of simplified programs in C.

General Examples:

Bitwise Operators Related:

Prime Number Related:

String Related Examples:

Example For Series: 

3 comments :

  1. Thank you so much for this. can you help me how to program this one? flames_.c

    The Flames Game is a relationship calculating algorithm that's famous between youngsters. At one point you might have heard about this and might have tried this out secretly. What does FLAMES stand for?
    F - Friends
    L - Lovers
    A - Acquaintances
    M - Married
    E - Enemies
    S - Sweethearts

    How do we calculate the FLAMES?

    It is very easy to explain with some example.
    Name1: Mark Manlimos
    Name2: Jinri Park

    Mainly, there are two steps:

    First, get the flames count.
    Take the two names ('Mark Manlimos' and 'Jinri Park')
    Remove the common characters regardless of case (common characters 'a', 'r', 'k', 'n', 'i')
    Get the count of the characters that are left (Removed a,r,k,n,i and the remaining are 3 m's,l,o,s,j and p. So a total of 8.)
    Next, get the flames result.
    We take the FLAMES letters ('F', 'L', 'A', 'M', 'E', 'S')
    And start removing letters using the flames count we got.
    The last letter remaining in the process is the result.

    In our example we got flames count = 8. So first we take FLAMES.
    FLAMES
    Then we start counting from the left up to flames count 8 (we go back to the beginning when flames count is greater than 6). Then remove the letter which is in the position 8th position. In this case it is 'L'. So the letters become:
    FAMES
    Then we start counting again from the letter next to what was just removed i.e., from 'A'. So the next character to be removed is 'E'. So our letters become:
    FAMS
    After next step:
    FAS
    Then:
    AS
    Last:
    A
    So the result is 'Acquaintances'.

    Your Task:
    Write a function flameCount that computes the flame count given two string name inputs.

    Write a function burn that prints the letters of the word FLAMES after each elimination given the flame count.

    Use string manipulation functions and add other user-defined functions if you feel necessary in order to solve the problem. Optionally, you can make your program continuous. A sample screenshot of how your program can look like is provided below. You can change the format especially the output of the burn function. :( Here's my email, jalrhee@yahoo.com. I really need help. :( Please.....

    ReplyDelete

Spam comments will be deleted. :)

 
Loading...
TOP