2. Write a c program to convert decimal number to octal number.
3. Write a c program to convert decimal number to hexadecimal number.
4. Write a c program to convert octal number to binary number.
3. Write a c program to convert decimal number to hexadecimal number.
4. Write a c program to convert octal number to binary number.
6. Write a c program to convert octal number to hexadecimal number.
8. Write a c program to convert hexadecimal number to octal number.
9. Write a c program to convert hexadecimal number to decimal number.
10. Write a c program to convert binary number to octal number.
9. Write a c program to convert hexadecimal number to decimal number.
10. Write a c program to convert binary number to octal number.
12. Write a c program to convert binary number to hexadecimal number.
13. C program for addition of binary numbers .
14. C program for multiplication of two binary numbers.
15. C program fractional binary conversion from decimal.
16. C program for fractional decimal to binary fraction conversion.
17. C program to convert decimal number to roman.
18. C program to convert roman number to decimal number.
19. C program to convert each digits of a number in words
20. C program to convert currency or number in word.
13. C program for addition of binary numbers .
14. C program for multiplication of two binary numbers.
15. C program fractional binary conversion from decimal.
16. C program for fractional decimal to binary fraction conversion.
17. C program to convert decimal number to roman.
18. C program to convert roman number to decimal number.
19. C program to convert each digits of a number in words
20. C program to convert currency or number in word.
18 comments:
hi mr. kumar i really like your site coz you a have a lot of sample programs that are already ran.
i hope that you could help about this kind of matter coz this my obstacle in studying computer science.
/**************Program to convert a number into words by BheemaPalina(0-1,00,00,000)***
output:
enter a num:12345(you can enter upto 1crore)
you have entered: twelve thousand three hundred forty five.
*******/
#include
#include
#include
void fun1(int n);
void fun2(int m);
void fun3(int j,int k);
void test1(int n);
void test2(int n);
void test3(int n);
void test4(int n);
int main()
{
int n;
printf("enter a num(1-100,00,000):");
scanf("%d",&n);
printf("\nyou have entered:");
if(n<=100)
test1(n);
else if(n>100&&n<1000)
test2(n);
else if(n>=1000&&n<=100000)
test3(n);
else if(n>100000&&n<=10000000)
test4(n);
return 0;
}
void test1(n)
{
int m,j,k;
if(n>=0&&n<=10)fun1(n);
else if(n>10&&n<20)
{
m=n%10;
fun2(m);
}
else if(n>=20&&n<=100)
{
j=n/10;
k=n%10;
fun3(j,k);
}
}
void test2(int n)
{
int b,c;
c=n/100;
fun1(c);printf(" hundred ");
b=n%100;
test1(b);
}
void test3(int n)
{
int a,b,c;
if(n==1000)
{
printf(" Thousand ");
exit(0);
}
else if(n==100000)
{
printf("Lakh");
exit(0);
}
else{
a=n/1000;
test1(a);printf(" Thousand ");
c=n%1000;
if(c<=99)test1(c);
else test2(c);
}
}
void test4(int n)
{
int a,b;
if(n==10000000)
{
printf("one crore");
exit(0);
}
a=n/100000;
test1(a);printf(" Lakhs ");
b=n%100000;
if(b==0)exit(0);
else if(b<=99)test1(b);
else if(b>99&&b<=999)test2(b);
else test3(b);
}
void fun1(int n)
{
switch(n)
{
case 0:printf("zero");break;
case 1:printf("one");break;
case 2:printf("two");break;
case 3:printf("three");break;
case 4:printf("four");break;
case 5:printf("five");break;
case 6:printf("six");break;
case 7:printf("seven");break;
case 8:printf("eight");break;
case 9:printf("nine");break;
case 10:printf("ten");break;
default:printf("");
}
}
void fun2(int m)
{
switch(m)
{
case 1:printf("eleven");break;
case 2:printf("twelve");break;
case 3:printf("thirteen");break;
case 4:printf("fourteen");break;
case 5:printf("fifteen");break;
case 6:printf("sixteen");break;
case 7:printf("seventeen");break;
case 8:printf("eighteen");break;
case 9:printf("nineteen");break;
default:printf("");
}
}
void fun3(int j,int k)
{
switch(j)
{
case 2:printf("twenty ");break;
case 3:printf("thirty ");break;
case 4:printf("fourty ");break;
case 5:printf("fifty ");break;
case 6:printf("sixty ");break;
case 7:printf("seventy ");break;
case 8:printf("eighty ");break;
case 9:printf("ninty ");break;
case 10:printf("hundred");break;
default:printf("");
}
fun1(k);
}
nice solution by Bheema
Could you please tell me the header files you have used.
#include
#include
int main()
{
int num;
int temp;
int rev = 0;
int r;
printf("\nEnter a number : ");
scanf("%d",&num);
temp = num;
while(temp > 0)
{
r = temp % 10;
temp = temp / 10;
rev = (rev * 10) + r;
}
temp = rev;
printf("\n");
while(temp > 0)
{
r = temp % 10;
temp = temp / 10;
switch(r)
{
case 0:
printf("Zero ");
break;
case 1:
printf("One ");
break;
case 2:
printf("Two ");
break;
case 3:
printf("Four ");
break;
case 4:
printf("Four ");
break;
case 5:
printf("Five ");
break;
case 6:
printf("Six ");
break;
case 7:
printf("Seven ");
break;
case 8:
printf("Eight ");
break;
case 9:
printf("Nine ");
break;
}
}
getch();
return 0;
}
#include
//begginning of function main
int main() {
//declaration
char firstnum,secondnum,thirdnum;
//initialization
firstnum=secondnum=thirdnum=0;
//prompt
printf("enter a number");
scanf("%d%d%d",&firstnum,&secondnum,&thirdnum);
firstnum=0;
switch (firstnum);
{
case 0: printf("zero");break;
case 1: printf("one");break;
case 2: printf("two");break;
case 3: printf("three");break;
case 4: printf("four");break;
case 5: printf("five");break;
case 6: printf("six");break;
case 7: printf("seven");break;
case 8: printf("eight");break;
case 9: printf("nine");break;
}
return 0;
}
write a program in c++ that convert digit into word like this(11330 == eleven thousand thirty three hundred) and also speak the output means speak the word ... can any one help me plz....
I need a c program that converts word into digit like (one thousand thirty one and sixty nine cents == 1031.69)
I really need it
The above program doesn't work integers ending with 0 or beginning with 0
stdio
stdlib
math
stdio
stdlib
math
isnt there a shorter code executing the same function?
isnt there a shorter code executing the same function?
yes,there is shorter code for this.
which works full efficiently.
Please tell me the solution of this program
Write a ‘C’ program to accept any 3 digit integer number from the keyboard and display the word equivalent representation of the given number.
I NEED ALGORITHM AND FLOWCHART FOR THIS ABOVE PROGRAM ... PLZ HELP ME OUT
Write a ‘C’ functions to arrange the elements of an integer array in such a way that all the negative elements are before the positive elements. The array is passed to it as an argument.
Please tell me the solution of this program
How do you answer this while using string? in C
Post a Comment