12,944,121 members (53,331 online)
Rate this:
See more:
I'm trying to print the currency symbol in my final calculation. Someone please offer some assistance?

I've been browsing around for examples, however most seems complex for my new learning of programming.

Kindly assist me, thank you.

Here's what my program looks like:

```main ()

{

char f_name[20], l_name[20], m_name[20];                                   //Character for the players full name is assigned here.

float bet, amt_won, amt_lost, total_win;                                    //variables to be used in the calaculation are defined here.

printf("Enter your first name:\t");                                         //Player is promted to input first name.
scanf("%s", &f_name);
printf("\nEnter your middle name:\t");                            // Middle name is entered
scanf("%s", &m_name);                                             // Middle name is accepted.
printf("\nEnter your last name:\t");                                 //Last name is entered.
scanf("%s", &l_name);                                             // Last name is accepted.

printf("\nHow much money would you like to bet?\t");               //Bet amount is asked to be placed.
scanf("%f", &bet);                                                 //Bet amount is accepted here.

amt_won=(bet*bet)/((bet*bet)-100*bet)* 25000;                           //Amount of money to be woned is calculated.

amt_lost = (0.35) * bet;                                                    //Amount of money lost during the gambles is accounted.

total_win = amt_won - amt_lost;                                            //Total winnings of the end of the game is equated.

printf("\nPLAYER: \t%s\t%s\t%s\n", f_name, m_name, l_name);                 //Players profile is displayed at the end of the game play.
printf("Total Winnings:\t %f", total_win);                                //Total earnings from the gamble is showed at the end.

getch();
return 0;
}```
Posted 14-Nov-12 14:35pm

Rate this:

## Solution 2

```printf("Enter your first name:\t");                                         //Player is promted to input first name.
scanf("%s", &f_name);

the '&' you should be missing,because the array name is the address of the first,scanf("%s",f_name),you should learn the array in c,the following is the same situation.good luckly.
I'am also a new programer.
}```

Top Experts
Last 24hrsThis month
 Maciej Los 210 CHill60 145 ppolymorphe 140 OriginalGriff 98 RyanDev 85
 OriginalGriff 4,653 CHill60 2,970 Maciej Los 2,388 Jochen Arndt 1,900 ppolymorphe 1,765