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
A trip takes 6 hours to complete. After traveling 1/4 of an hour, 1 3/8hours, and 2 1/3 hours, how much time does need to complete the trip? There are 30 socks in a drawer. 60% of the socks are red and the rest are blue. What is the minimum number of socks that must be taken from the drawer without looking in order to be certain that atleast two blue socks have been chosen?
SEND + MORE = MONEY. Then what is the value of M + O + N + E + Y ?
In a 10 digit number, if the 1st digit number is the number of ones,2nd digit number is the number of twos, and ... so on. 10th digit is the number of zeroes,then find the number
The price of raw materials has gone up by 15%, labour cost has also increased from 25% of the cost of raw material to 30% of the cost of raw material. By how much percentage should there be a reduction in the usage of raw materials so as to keep the cost same
cgl2010 tier 2 ki merit kya rhgi
i attended sbi clerical interview on28/04/10.on 20/08/10 i called sbi headoffice 022-22024619 they said tht final result will be declared after 2 months.i also had another no 022-22826300.if anybody are interested cal those no's.my mobile no is 9010347790(udamsingh)
if the area of square increases by 69% then side of the square increases by:
In a party man & his wife ,and there r 2 son with their wives, and every son has 4 children in his family .how manyperson r in party.
There are 600 tennis players 4% wear wrist band on one wrist Of the remaining, 25% wear wrist bands on both hands How many players don't wear a wrist band?
15 lit of water containing 20 % of alcohol ,then added 5 lit of water .What is the % of alcohol?
A man has 2 cows of total cost 200 rupees. He sold them for 210. For 1 cow he had a profit of 10% and for the other he had a loss of 10%. What is the price of each cow?
What do you think are your personal strengths and what are the areas where you need to improve as an individual?
ram singh goes to his office in the city, every day from his suburbun house. his driver mangaram drops him at the railway station in the morning and picks him up in the evening. Every evening ram singh reaches the station at 5 o'clock. mangaram also reaches at the same time. one day ramsingh started early from his office and came to the station at 4 o'clock. not wanting to wait for the car he starts walking home. Mangaram starts at normal time, picks him up on the way and takes him back house, half an hour early. how much time did ram singh walk.
A person has Rs 100/- in his pocket, he can as 25 pencils or 15 books. He kept 15% of the money for travelling expenses and purchased 5 pencils. So how many books he can purchase with the remaining money.
A can do a piece of work in 30 days, which B can do in 20 days. Both started the work but A left 5 days before the completion of the work. It took how many days to complete the work?