cneil
December 20th, 2006, 08:59 AM
I'm using a bash shell in a gnome terminal. I am trying to start a little bit of C programming. I can't seem to get the british pound symbols and japanese yen symbols to output correctly.
Here is the code that I am working with
#include <stdio.h>
#define POUNDS 0x9c
#define YEN 0x9e
int main()
{
float amount,bp,jy;
float d2p = 0.5407; /*dollars per pound*/
float d2y = 107.79; /*dollars per yen*/
printf("Enter the amount in dollars: $");
scanf("%f", &amount);
bp = amount * d2p;
jy = amount * d2y;
puts("Currency Conversion:");
printf("%c%f\n",POUNDS,bp);
printf("%c%f\n",YEN,jy);
return(0);
}
Here is the code that I am working with
#include <stdio.h>
#define POUNDS 0x9c
#define YEN 0x9e
int main()
{
float amount,bp,jy;
float d2p = 0.5407; /*dollars per pound*/
float d2y = 107.79; /*dollars per yen*/
printf("Enter the amount in dollars: $");
scanf("%f", &amount);
bp = amount * d2p;
jy = amount * d2y;
puts("Currency Conversion:");
printf("%c%f\n",POUNDS,bp);
printf("%c%f\n",YEN,jy);
return(0);
}