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 student got 70% in one subject,80% in other.to get overall 75% how much he should get in third subject

10 Answers   Cognizant, Patni,


A school has 30% students from Maharashtra .Out of these 20% are Bombey students. Find the total percentage of Bombay?

1 Answers   3i Infotech, Canara Bank, Geodesic,


(165)2 - (164)2 =

6 Answers  


In a class of 60 students, the number of boys and girls participating in the annual sports is in the ratio 3 : 2 respectively. The number of girls not participating in the sports is 5 more than the number of boys not participating in the sports. If the number of boys participating in the sports is 15, then how many girls are there in the class? (1) Data inadequate (2) 20 (3) 25 (4) 30 (5) None of these

12 Answers  


A car has run 10000 miles using 5 tyres interchangably,To have a equal wornout by all tyres how many miles each tyre should have run. answer 4000 miles/tyre

1 Answers   Accenture,


if 2 miles of fence enclose a square plot of 160 acres,how large a square will 4 miles of fence

3 Answers  


if x=y=2z and xyz =256 then x=

1 Answers  


If 9x-3y=12 and 3x-5y=7 then 6x-2y = ?

1 Answers   Cisco, Mu Sigma,


A triangle ABC is given, a line DE is parallel to base side and that cuts the triangle. The ratio of area of triangle to the area of trapezium given DE/BC= ?

1 Answers   Cisco,


sam and mala have a conversation. sam says i am vertainly not over 40. mala says i am 38 and you are atleast 5 years older than me. Now sam says you are atleast 39. all the sattements by the two are false. How hold are they realy.

1 Answers   InfoTest,


A fold density is 19 times greater than the water and for copper it is 9 times.At what ratio you can mix gold and copper to get 15 times denser than water.

1 Answers   Hexaware,


Find the correct choice if the sum of any 4 consecutive numbers is divisible by a number?

1 Answers   Aricent,


Categories