Question about Borland Turbo C++ Suite 1.0 (TCB0000WWFS180) for PC

2 Answers

Write a program that accept a number and output its equivalent in words.

Posted by on

Ad

2 Answers

  • Level 2:

    An expert who has achieved level 2 by getting 100 points

    MVP:

    An expert that gotĀ 5 achievements.

    Governor:

    An expert whose answer gotĀ voted for 20 times.

    Hot-Shot:

    An expert who has answered 20 questions.

  • Expert
  • 62 Answers

Below is the program written in Turbo C.

#include<stdio.h>
void pw(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
{
pw((n/10000000),"crore");
pw(((n/100000)%100),"lakh");
pw(((n/1000)%100),"thousand");
pw(((n/100)%10),"hundred");
pw((n%100)," ");
}
getch();
}

void pw(long n,char ch[])
{
(n>19)?printf("%s %s ",ten[n/10],one[n%10]):printf("%s ",one[n]);
if(n)printf("%s ",ch);
}

Posted on Aug 06, 2010

  • Arlon Lagata Aug 20, 2013

    how about in assembly language?

×

Ad
  • Level 1:

    An expert who has achieved level 1.

  • Contributor
  • 3 Answers

P=11 q=13 e=11 calculate n . d

Posted on Jan 19, 2011

Ad

1 Suggested Answer

6ya6ya
  • 2 Answers

SOURCE: I have freestanding Series 8 dishwasher. Lately during the filling cycle water hammer is occurring. How can this be resolved

Hi,
a 6ya expert can help you resolve that issue over the phone in a minute or two.
best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.
the service is completely free and covers almost anything you can think of (from cars to computers, handyman, and even drones).
click here to download the app (for users in the US for now) and get all the help you need.
goodluck!

Posted on Jan 02, 2017

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

1 Answer

I WOULD LIKE TO KNOW EQUIVELENT OF TDA9340PS/N3/A/1923


If you enter the IC number into Google you can find places that have the original model, so why would you want an equivalent?

Feb 11, 2014 | LG 47LB9DF LCD TV, 47 ViewabImage Size,...

1 Answer

Write a program that accept a number and output its equivalent in word


Use the value that will be printed by the keyboar.
After you enter the value.
You have to cast the type you have used as integer or float into string or character type.
So here the type casting of the datatype will be used.

Oct 10, 2011 | Borland Turbo C++ 4.5 Full Version for PC

1 Answer

Hi my printer will not print. it is saying printer spool error.


> spool error

S.P.O.O.L. == Simultaneous Peripheral Output On Line

The "spool" is a combination of disk-space on your 'C:' drive, and software to "accept" the print-image (as fast as MS Word can create the print-image), and save the print-image to disk-space,
so that MS Word can report "print completed", so that you can use MS Word, instead of waiting until the physical printing has completed.

Then, the printer-spooling software will read from the print-image file, and send it to the printer, only as fast as the printer will accept it.

Feb 05, 2011 | Xerox Office Equipment & Supplies

1 Answer

Hey i m using Apple i dnt hv office in my laptop so can i use Microsoft word online .


You can download OpenOffice, which is compatible with Microsoft Word. Its free! And you can get all the other MS compatible office programs, as well as a Word equivalent.

http://newopenoffice2010.com/

Apr 06, 2010 | Microsoft Office Word 2003 for PC

2 Answers

My new acer aspire will not accept the product number for word. I am using the trial, but bought the program cd. I figured all I needed to do was put the product number in, but keeps saying it is typed...


You have to install the CD version. Go to add/remove programs and uninstall the trial version first, then install the CD version and you should be good to go. This will not affect any data that you've created using the software (documents and such).

Feb 13, 2010 | Acer Aspire One Netbook 8.9" Notebook

1 Answer

Please Solve this C++ Program


Write a program to prompt the user to input several lines of input. A line of inputs is terminated by '*'. For each readline of input the program should output:(use pointer notation for the array) . The total # of words . The lenght of the longest word in the line At the end the program should output: . The total number of words read in all lines of input . The lenght of the longest word read in all lines of input

Jan 19, 2009 | Computers & Internet

2 Answers

Source code for word count


Haha, i wrote one of thee a while ago for a competition. You need to us e the char at function mate :D
Inside a for loop
Ill havea look for you though :D

Sep 09, 2008 | ArcMedia JavaScript Source Code 3000 Pro...

1 Answer

Plz give me C code for the given program


I have the code in java. can you convert.
if need
mail to p.stivel@gmail.com

Feb 23, 2008 | Computers & Internet

Not finding what you are looking for?

Open Questions:

0 Answers

how to write c/ c++ sourcecode for Merkle-Hellman Knapsack Public Key Cryptosystem ??? In this problem you will implement the Merkle-Hellman Knapsack cryptosystem. The encryption and decryption algorithms are based on solving a knapsack problem. The knapsack problem consists of finding a way to select some of the items to be packed such that their sum (the amount of space they take up) exactly equals the knapsack capacity (the target). Formally the knapsack problem is as follows: Given a set S = {a1, a2, ..., an} and a target sum T, where each ai >= 0, is there a selection vector V={v1,v2,...,vn} each of whose elements is 0 or 1, such that (ai*vi) = T. The idea behind Merkle-Hellman scheme is to encode a binary message as a solution to a knapsack problem reducing the cipher text to the target sum obtained by adding terms corresponding to 1s in the plaintext. That is, blocks of plain text are converted to knapsack sums by adding into the sum the terms that match with 1bits in the plaintext as shown below: Plaintext: 1 0 1 0 0 1 Knapsack: 1 2 5 9 20 43 Cipher text: 49 Plaintext: 0 1 1 0 1 0 Knapsack: 1 2 5 9 20 43 Cipher text: 27 The receiver will have to use the cipher text (the target sum) to recover the plaintext. A knapsack problem is said to be ``easy'' if {missing}. The solution for the easy knapsack problem is straightforward, and can be achieved in O(n).Furthermore, there exists a way for transforming an easy knapsack set S into a non-easy knapsack H simply by multiplying the elements of S by w mod n where w and n are well chosen integers. Formally the terms of H are: hi = (w*si) mod n. For example if S = {1, 2, 4, 9}, w = 15, and n = 17 then H = {15, 13, 9, 6}. Encryption algorithm (executed by the sender) H is called the public key and is made public by the receiver Choose w and 1. n such that n > max(S) and n is prime, and w < n. Construct H from S, w, and n. Sender uses H to encipher blocks of m bits P0 = [p1, p2...pm], P1 = [pm+1, pm+2...p2m] and so forth (m is the number of terms in H), as follows: Ti = Pi*H = (pj*hj). Thus T0 = P0*H, T1 = P1*H and so on. Ti are then transmitted to the receiver via a reliable channel. 1. Decryption algorithm (executed by the receiver) The tuple (S, n, w) is called the private key and is kept secret by the receiver Use w and n to compute w-1 where w-1*w = 1 mod n. if n is prime then w-1 = w (n-2) mod n 2. Compute Ai = w-1*Ti mod n 3. Find Pi by solving Ai = Pi*S Input file The input consists of N test cases. The number of them (N) is given on the first line of the input file. Each test case begins with a line containing a plaintext to be encrypted. The second line contains the number of elements (m) in the knapsack S that show in the third line. The knapsack elements are positive integers separated by space. The fourth line of each text case contains n and w in this order separated by space. Output file Print exactly 3 lines for each test case. The first line should contain the encrypted values of the plaintext of the set separated by space. The second line should contain the plaintext obtained by applying the decryption algorithm to the plaintext, preceded by `Recovered plain text: '. The third line should contain the value of w-1 Sample Input 2 Salaam! 4 1 2 4 9 17 15 hello there? 4 1 2 4 9 19 7 Sample Output 29 25 22 16 22 28 22 16 22 16 22 44 9 16 0 24 Recovered plain text: Salaam! 8 23 7 23 20 23 21 23 21 23 36 9 0 29 14 23 7 23 20 29 9 23 20 15 36 0 16 Recovered plain text: hello there? 11

Feb 24, 2009 | Borland Turbo C++ Suite 1.0...

Borland Turbo C++ Suite 1.0 (TCB0000WWFS180) for PC Logo

1,219 people viewed this question

Ask a Question

Usually answered in minutes!

Top Borland Computers & Internet Experts

Tony

Level 3 Expert

2600 Answers

Yoav Shilon
Yoav Shilon

Level 2 Expert

104 Answers

k24674

Level 3 Expert

7993 Answers

Are you a Borland Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...