A table containing decimal nos. from 1 to 100 and their
roman Equivalent was given. We were required to write a
function : char* ConverToRoman(int number) : to
convert the given number( 1<=number<=100) into its numerical
equivalent.

I want a solution in C/C++ language



A table containing decimal nos. from 1 to 100 and their roman Equivalent was given. We were require..

Answer / monu rohila

public static string GetPalindromeString(string theInputString)
{

int j = 0;
int k = 0;
string aPalindrome = string.Empty;
string aLongestPalindrome = string.Empty ;
for (int i = 1; i < theInputString.Length; i++)
{
k = i + 1;
j = i - 1;
while (j >= 0 && k < theInputString.Length)
{
if (theInputString[j] != theInputString[k])
{
break;
}
else
{
j--;
k++;
}
aPalindrome = theInputString.Substring(j + 1, k - j - 1);
if (aPalindrome.Length > aLongestPalindrome.Length)
{
aLongestPalindrome = aPalindrome;
}
}
}
return aLongestPalindrome;
}
`

Is This Answer Correct ?    1 Yes 14 No

Post New Answer

More General Aptitude Interview Questions

A helicopter drops two trains, each on a parachute, onto a straight infinite railway line. There is an undefined distance between the two trains. Each faces the same direction, and upon landing, the parachute attached to each train falls to the ground next to the train and detaches. Each train has a microchip that controls its motion. The chips are identical. There is no way for the trains to know where they are. You need to write the code in the chip to make the trains bump into each other. Each line of code takes a single clock cycle to execute. You can use the following commands (and only these); MF - moves the train forward MB - moves the train backward IF (P) - conditional that's satisfied if the train is next to a parachute. There is no "then" to this IF statement. GOTO

7 Answers   ASD Lab, HP, Micro Labs, Microsoft,


In June a baseball team that played 60 games had won 30% of its game played. After a phenomenal winning streak this team raised its average to 50% .How many games must the team have won in a row to attain this average? A. 12 B. 20 C. 24 D. 30

5 Answers   L&T,


If a triangle has a base B and the altitude of the triangle is twice the base, then the area of the triangle is

3 Answers   zilog,


Rohan bought some rice at Rs. 10 per kilogram. He buys 2 kg rice from a ration store at the rate of Rs. 8 per kilogram. He mixes the two type of rice and sells at Rs. 11 per kilogram. He makes 25% profit. What is the ratio of non-ration to ration rice?

0 Answers   Cap Gemini,


What is modulation &demodulation?

1 Answers  






If x + 8y = 20 and x = -3y, then y =

7 Answers   Paladon,


Find the missing number in the series: 2, 5, __ , 19 , 37, 75

0 Answers   TCS,


4 couples have a party.Depending on the set of statements,find who insulted whom and who is the host of the party.

0 Answers   Infosys,


sir, i need help in preparing the exam .so, please help me by sending some question papers to my mail address neela_david@rediffmail.com

1 Answers   Banking, Central Bank of India,


price of a product is reduced by 30% . What percentage should be increased to make it 100%

6 Answers   CMC,


if A = D, B=E, C=F, SHOOT = ?

0 Answers   Baan Infotech,


A family I know has several children. Each boy in this family has as many sisters as brothers but each girl has twice as many brothers as sisters. How many brothers and sisters are there?

0 Answers   Infosys,


Categories