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
Answer Posted / 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 View All Answers
Radha,Geeta&Revathi went for a picnic.After a few days they forgot the date,day and month on which they went to picnic.Radha said that it was on Thursday,May 8 and Geeta said that it was Thursday May 10.Revathi said Friday Jun 8.Now one of them told all things wrongly,others one thing wrong and the last two things wrongly.If April 1st is tuesday what is the right day,date and month? thought that he should not waste his time and started moving towards his residence at the speed of 3mi/hr.On the way,he gets the coach and reaches home at 6 o'clock.How far is his residence from railway station.
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?
what is focus liner in gc hs?
Ronak's mother is the only daughter of Jasmeet's father. How is Jasmeet's husband related to Ronak?
perimeter of rectangle is s and the other side is x, then the other side
a vendor solds two things at same cost 12 RS with one item at 25%profit and other at 20%loss,by this transaction he made profit or loss by how much
If f(0)=1 and f(n)= f(n-1)*n, find the value of f(4).
the word unimpressive was given.they asked us to do change 1st & 2nd,3rd & 4th,so on.then they asked what will be 10th letter from right?
My name is deepshikha .if any one have quentiles apptitude question paper please mail me on diffmail172@gmail.com.
A car is filled with four and half gallons of oil for full round trip. Fuel is taken 1/4 gallons mor3 in going than coming. What is the fuel consumed in coming up?
What is the max possible 3 digit prime number?
If g (0)=g (1)=1 And: g (n)= g (n-1) + g (n –2) find g (6);
A simple interest amount of Rs 6000 for 6 months is Rs 600. Calculate the annual rate of interest.
2. Why would you choose a database system instead of simply storing data in operating system files? Give and explain advantages of using DBMS.
Pankaj walks east and turns right and then from there to his left and then 45degrees to his right. In which direction did Pankaj go?