I am trying to convert this program to international numerical system, its in Indian system any suggestions will help - #include<stdio.h>
-
#include<conio.h>
-
-
void convert(long,char[]);
-
-
char *one[]={" "," one"," two"," three"," four"," five"," six"," seven","eight"," Nine"," ten"," eleven"," twelve"," thirteen"," fourteen","fifteen"," sixteen"," seventeen"," eighteen"," nineteen"};
-
char *ten[]={" "," "," twenty"," thirty"," forty"," fifty"," sixty","seventy"," eighty"," ninety"};
-
-
-
void main()
-
{
-
long n;
-
clrscr();
-
printf("Enter any 9 digit no: ");
-
scanf("%9ld",&n);
-
if(n<=0)
-
printf("Enter numbers greater than 0");
-
else
-
{
-
convert((n/10000000),"crore");
-
convert(((n/100000)%100),"lakh");
-
convert(((n/1000)%100),"thousand");
-
convert(((n/100)%10),"hundred");
-
convert((n%100)," ");
-
}
-
getch();
-
}
-
-
-
void convert(long n,char ch[])
-
{
-
(n>19)?printf("%s %s ",ten[n/10],one[n%10]):printf("%s ",one[n]);
-
if(n)printf("%s ",ch);
-
}
0 1477 Sign in to post your reply or Sign up for a free account.
Similar topics
by: Sverre Bakke |
last post by:
Hi
I am using the base_convert() function to convert numbers between binary,
hexadecimal, decimal, etc... It works great, but I have problems converting
numbers with .'s
Like this number:
...
|
by: Yan Vinogradov |
last post by:
There are two ways to convert a char* received from the unmanaged code
into a managed System.String object that I am aware of. The first one
is to simply construct String object passing char* as...
|
by: MeganTSU |
last post by:
Hey yall! I am trying to get this program finished for class.... It
says that you are suppposed to write a program that will display a
check formatted out put (the output looks like a check). I got...
|
by: Sidney |
last post by:
Dear,
I am writting a system which opened at the system tray. But every before
I shut down my computer,
I have to close the system first. However, it should be automatically
close when I shutting...
|
by: iwdu15 |
last post by:
hi, how can i convert type Short to Unicode strings? the
System.Text.UnicodeEncoding cant convert it if the length is too shrot....so
i need to do this manually. how can i do this
--
-iwdu15
|
by: bijondhanbad |
last post by:
If any one can can help me out with a function or module to convert numbers to words in the Indian system of numerals..........
Like 1,24,53,432 will read as one crore twenty four lakhs fifty three...
|
by: shara |
last post by:
Hello there,
Can anybody help me with this.I'm working on VB macros and i came across a situation where i have to convert numbers to column alphabets i.e....
|
by: Vivienne |
last post by:
Hi,
I am using a c# library in my c++ project. so I have to convert a
basic string to System::string to make use of a function that takes
System::String as argument. I did it like this:
...
|
by: byte8bits |
last post by:
Here's how I'm doing this right now, It's a bit slow. I've just got
the code working. I was wondering if there is a more efficient way of
doing this... simple example from interactive Python:
...
|
by: Dormilich |
last post by:
I recently found a problem I haven't seen a good solution yet.
this is just the general conversion from a number between number/notation systems (e.g. decimal, binary, octadecimal notation)
∞ ...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |