Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

A man can row downstream at a rate of 14 kmpl & upstream at 9 kmpl. Find man's rate in still water ?

1358


A, B ans C are three speakers. They have to speak randomly along with another 5 speakers in a function. A has to speak before B and B has to speak before C. What is the probability.

1141


Himesh works thrice as much as Bhavin. Find the number of days it would take to complete the work if both work together if Himesh takes 60 days less than Bhavin to do a work.

1139


Scientific publishing aptitude interview question

1476


if area is icc. by 30% then what is the change in the area?

2048


The base 5 representation of the decimal number 2048 is _____.

1292


Refer to the figure below.A ship started from P and moves at a speed of I miles per hour and another ship starts from L and moving with H miles per hour simultaneously.Where do the two ships meet? ||---g---||---h---||---i---||---j---||---k---||---l---|| PG H I J K L are the various stops in between denoted by || . The values g, h, i, j, k, l denote the distance between the ports.

1254


1/8 Is divided by 's' , if 's' is increased by 2 times, what Will be the result.

1852


Find the value of @@+25-++@16, where @ denotes "square" and + denotes "square root".

2535


Three independent mechanisms A, B and C have been incorporated for power saving in a plant producing respectively 30%, 40% and 10% efficiency. Assuming that they operate independently, what is the net power efficiency achieved

2821


What is the angle of degree suspended when two hands of clock showing the time 2.30.

1326


Find the next series: AD DP PL LV ?

1295


A son and father goes for boating in river upstream . After rowing for 1 mile son notices the hat of his fathe falling in the river.After 5 min. he tells his father that his hat has fallen. So they turn round and are able to pick the hat at the point from where they began boating after 5min. Tell the speed of river?

1223


What is the value of a property, which has been insured at the rate of 1/6% of its value, if the annual premium paid on it is Rs. 83.33 (in Rs.)?

1913


There are 8 stamps, 4 Red and 4 Green. There are three logicians also. One moderator sticks thow stamps each on the forhead of each logician such that each of them can see all the stamps except those on his forhead and the two in moderator's pocket. Then the moderator asked each whether he knows the colors of the stamps he wears? Then the answeres were: A: "No" B: "No" C: "No" A: "No" B: "Yes" What were the colours of the stamps that B wears?

1267