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
Time constant for an integrator and differentiator should be
A farmer built a fence around his 17 cows, in a square shaped region. He used 27 fence poles on each side of the square. How many poles did he need altogether?
A printer produced 176,400 pages in a given day. If the printer was in operation for seven hours during the day, how many pages did it print per minute?
sadrine's avg on four tests is 80 which of the following cannot be the number of tests on which she earned exactly 80 points
If the area of a square increases by 69%, then the side of the square increased by
on an item a company gave 25% discount then they get 25% profit if it gives 10% discount then what is the profit.
If A=Z, B=Y, C=X, .......... Z=A, Then GROUP = ?
how to learn aptitude quickly
In 1978, a kg of paper was sold at Rs25/. If the paper rate increases at 1.5% more than the inflation rate which is 6.5% a year, then what will be the cost of a kg of paper after 2 years?
A moves 3 kms east from his starting point . He then travels 5 kms north. From that point he moves 8 kms to the east.How far is A from his starting point?
What is the selling price of a car? If the cost of the car is Rs.60 and a profit of 10% over selling price is earned.
what types of question tricom will ask
HOW + MUCH = POWER Then P + O + W + E + R =
Each row of letters or numbers has a rule connecting them. Write the next number or letterin the brackets. 1 , 4 , 9 , 16 , 25 , 36 , (_ _ _)
A fuel dealer mixes two brands of fuel which cost in the ratio 2:3 A solution of 30% Brand A with Brand B yields profit of 10% when sold at RS 297. What is cost of brand B?