write a c program which reads an integer value from the keyboard then it displays the number in words?
#include<stdio.h>
#include<conio.h>
void main(void)
{
int rev,n,
clrscr();
printf("\n enter any number");
scanf("%d",&n);
temp=n;
while(n>0)
{
rem=temp%10;
rev+=rem*10;
temp=temp/10;
choice=rev%10;
switch(choice)
{
case 1:
printf("one");
break;
case 2:
printf("two");
break;
case 3:
printf("three");
break;
case 4:
printf("four");
break;
case 5:
print("five");
break;
case 6:
printf("six");
break;
case 7:
printf("seven");
break:
case 8:
printf("eight");
break:
case 9:
printf("nine");
}
getch();
}
#include
#include
void one(int m)
{ int n;
n=m%10;
switch(n)
{ case 1:printf("One");
case 2:printf("Two");
.
.
.
case 9:........
}
}
void ten(m)
{ int a=m%10;
switch(m)
{ case 11:printf("Eleven");
........
case 15:....
}
if(m>15 && m<20)
{ one(a);
printf("teen");
}
else if(m>=20 && m<30)
{ printf("Twenty");
one(a);
}
else if(m>=30 && m<40)
{..........
}
..........
else
{ printf("Ninety");
one(a);
}
}
void hundred(int m)
{ int a=m%10,b,c;
b=a%10;
c=b%10;
one(c);
printf("Hundred");
d=b*10+a;
ten(d);
}
void main()
{ int a[3],i,n,m,c=0,r;
printf("\nEnter the no. in decimal:");
scanf("%d",&n);
m=n;c=0;
for(i=0;i<3;i++)
a[i]=0;
i=0;
do
{ r=n%10;
n%=10;
a[i]=r;
c++;
}while(n!=0);
if(c==1)
one(m);
else if(c==2)
ten(m);
else
hundred(m);
getch();
}
Just tried to give u an idea.May not be just perfect.
Use For..Next of Do..Loop function. For example,
*create a listbox named "List1".
*create a commandbutton then double click the button and copy-paste the code below.
Dim theIndex as Integer
For theIndex=0 to 299
List1.AddItem theIndex
Next
*run(f5) and click the button.
here it is
http://www.fileden.com/files/2008/9/1/2076797/randomgen0to999.txt
use "\n" between the words where you want a new line
yyu5uty
You write it exactly the same as you would write it in any other verions of C++, by taking user input to determine the three sides of your triangle. In other words, input three real numbers. What you do with those three numbers is entirely up to you, but presumably you'd want to calculate the angles of a triangle given the length of its three sides. For that you would need to use the cosine rule which states that for any triangle with angles A, B and C whose opposing sides are a, b and c respectively, cos A = (b2 + c2 - a2)/2bc and cos B = (c2 + a2 - b2)/2ca. Knowing two angles, A and B, you can easily work out that angle C must be 180 - (A + B).
Numbers, pictures and words
Flip the paper over otherwise you might need a special printer
Write it in your own words on paper or print it
write the following decimal numbers in words .0087945
write 1,067,350.00 in words
You do not write numbers in exponent for in words.
Create an array like so $numbers = array(); $numbers['0'] = "ZERO"; $numbers['1'] = "ONE"; and so on.. till you decide that's enough then to print it, echo the array with the desired key like so.. Example I print 5 in words echo $numbers['5']; which would print FIVE Good luck
Usually numbers. Unless you are young, writing it in words can be tedious!
in words ninety in numbers 90
778.5 in words
It is five hundredths.
You write in the numbers in words when you write in expanded.
In ordinary writing, the numbers one through ten are written as words. Higher numbers are written as numbers.A sentence should not start with a numeral, so write out the number (or reword the sentence).
You cannot. If you do not have numbers, you must have words - even if they are words that only the person writing and reading can understand them.