2. Counting in Lojban, an artificial language developed
over the last fourty years, is easier than in most languages
The numbers from zero to nine are:
0 no
1 pa
2 re
3 ci
4 vo
5 mk
6 xa
7 ze
8 bi
9 so
Larger numbers are created by gluing the digit togather.
For Examle 123 is pareci
Write a program that reads in a lojban string(representing
a no less than or equal to 1,000,000) and output it in
numbers.

Answer Posted / ts

U can easily do this in c i am writing a code you just make its function by your self.Its easy one

#include<stdio.h>
main()
{
int i=0;
char ptr,d;
char c[20];
do
{
printf(" \n Enter the lujban String whose equivalent number is to be printed \n");
scanf("%s",c);
while(c[i]!='\0')
{

switch(c[i])
{
case'n':printf("0");
break;
case 'p':printf("1");
break;
case 'r':printf("2");
break;
case 'c':printf("3");
break;
case 'v':printf("4");
break;
case 'm':printf("5");
break;
case 'x':printf("6");
break;
case 'z':printf("7");
break;
case 'b':printf("8");
break;
case 's':printf("9");
break;
}
i++;
}
printf(" \nDo you want to continue(Y/N)");
d=getche();

}
while(d=='y'||d=='Y');

}

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the return type of sizeof?

588


write a c program to calculate sum of digits till it reduces to a single digit using recursion

2716


Is there a built-in function in C that can be used for sorting data?

742


What are the application of c?

642


What is the significance of c program algorithms?

677






When is the “void” keyword used in a function?

829


Are there constructors in c?

591


What is indirection? How many levels of pointers can you have?

656


In c programming language, how many parameters can be passed to a function ?

627


What is masking?

633


Is it possible to execute code even after the program exits the main() function?

809


What are the various types of control structures in programming?

625


a number whose only prime factors are 2,3,5, and 7 is call humble number,,write a program to find and display the nth element in this sequence.. sample input : 2,3,4,11,12,13, and 100.. sample output : the 2nd humble number is 2,the 3rd humble number is 3,the 4th humble number is ,the 11th humble number is 12, the 12th humble number is 14, the 13th humble number is 15, the 100th humble number is 450.

4541


Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal. [ I gave the obvious solution of taking % 10 and / 10, which gives us the decimal value in reverse order. This requires an array since we need to print it out in the correct order. The interviewer wasn't too pleased and asked me to give a solution which didn't need the array ].

637


An application package has been provided to you without any documents for the following application. The application needs to be tested. How will you proceed?

666