473,383 Members | 1,862 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Converting Numbers from Indian system to International system

I am trying to convert this program to international numerical system, its in Indian system any suggestions will help

Expand|Select|Wrap|Line Numbers
  1. #include<stdio.h>
  2. #include<conio.h>
  3.  
  4. void convert(long,char[]);
  5.  
  6. char *one[]={" "," one"," two"," three"," four"," five"," six"," seven","eight"," Nine"," ten"," eleven"," twelve"," thirteen"," fourteen","fifteen"," sixteen"," seventeen"," eighteen"," nineteen"};
  7. char *ten[]={" "," "," twenty"," thirty"," forty"," fifty"," sixty","seventy"," eighty"," ninety"};
  8.  
  9.  
  10. void main()
  11. {
  12.  long n;
  13.  clrscr();
  14.  printf("Enter any 9 digit no: ");
  15.  scanf("%9ld",&n);
  16.  if(n<=0)
  17.                 printf("Enter numbers greater than 0");
  18.  else
  19.  {
  20.                   convert((n/10000000),"crore");
  21.                   convert(((n/100000)%100),"lakh");
  22.                   convert(((n/1000)%100),"thousand");
  23.                   convert(((n/100)%10),"hundred");
  24.                   convert((n%100)," ");
  25.  }
  26.  getch();
  27. }
  28.  
  29.  
  30. void convert(long n,char ch[])
  31. {
  32.  (n>19)?printf("%s %s ",ten[n/10],one[n%10]):printf("%s ",one[n]);
  33.  if(n)printf("%s ",ch);
  34. }
Nov 15 '17 #1
0 1477

Sign in to post your reply or Sign up for a free account.

Similar topics

2
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: ...
4
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...
7
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...
0
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...
6
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
10
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...
0
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....
1
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: ...
5
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: ...
6
Dormilich
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) ∞ ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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$) { } ...
0
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...
0
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...
0
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
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.