Program for this?

Write your question here.

1
2
3
4
5
6
7
8
  
	X C O M P U T E R S
	0 1 2 3 4 5 6 7 8 9
	
	ENTER 489.50
	OUTPUT PRS.UX

thanks :D
Hi,

could you show us what you did/tried?
Figured it out already thanks anyways :D


//strcmp
#include <iostream>
#include <string.h>
#include <conio.h>
using namespace std;
int main()
{
char sprice[10];
int slength,i;
cout << "Enter price\n";
gets (sprice);
slength=strlen(sprice);
for (i=0;i<slength;i++)
{
switch(sprice[i])
{
case '0': cout << "X"; break;
case '1': cout << "C"; break;
case '2': cout << "O"; break;
case '3': cout << "M"; break;
case '4': cout << "P"; break;
case '5': cout << "U"; break;
case '6': cout << "T"; break;
case '7': cout << "E"; break;
case '8': cout << "R"; break;
case '9': cout << "S"; break;
case '.': cout << "."; break;
}


}




getch();
return 0;
}
Topic archived. No new replies allowed.