In a global Mathematics contest, the contestants are told to invent some special numbers which can be built by adding the squares of its digits. Doing this perpetually, the numbers will end up to 1 or 4.
If a positive integer ends with 1, then it is called the Number of Game.
An example from above is:
13 = 1^2 + 3^2 = 1+9 = 10 (Step:1)
10 = 1^2 + 0^2 = 1+0 = 1 (Step:2), iteration ends in Step 2 since number ends with 1
Then in next round, the contestants are asked to combine their newly invented number, i.e. Number of Game with prime number.
Now, being a smart programmer, write a program to help the contestants to find out the Nth combined number within any given range, where N can be any integer.
Input Format:
Input consists of 3 integers X, Y, N, one on each line. X and Y are upper and lower limits of the range. The range is inclusive of both X and Y. Find Nth number in range [X,Y].
Line 1
X,where X is the upper limit of the range
Line 2
Y,where Y is the lower limit of the range
Line 3
N,where Nth element of the series is required
Constraints:
X <= Y
X > 0
N > 0
Output Format:
Output will show the Nth element of the combined series lying in the range between X and Y.
Line 1
For Valid Input,print
U,where U is the Nth element of the combined number series lying in the range between X and Y.
Or
No number is present at this index
For Invalid Input,print
Invalid Input
Sample Input and Output
SNo. Input Output
1 1,30,3 19
2 12,33,5 No number is present at this index
3 -5,@,4 Invalid Input
how to solve this question?

## java

vikas malikMay 27, 2011 at 5:43 PMQuestion are very helpful to clear the concept

## PLZ GIVE ME INTERVIEW TIPS

KALAISELVANAugust 12, 2011 at 7:40 PMI WANT JAVA INTERVIEW QYUESTION AND ANSWER

## java

P.Rampriya b.com caDecember 2, 2011 at 3:02 PMjava questions please tell the sir

## java

P.Rampriya b.com caDecember 2, 2011 at 3:10 PMjava question please tell me sir but jop vancanies

## java questions

visuJanuary 2, 2012 at 6:59 PMgood one

## SEND JAVA BASIC

S.SASIKALAJanuary 3, 2012 at 10:56 AMI NEED BOTH QUETIONS AND ANSWERS IN JAVA PROGRAMS

## java question

kirti raniFebruary 13, 2012 at 8:52 PMtell me difference between jre version & jre that resie in jdk.

## java/j2ee interview Question

vajsurSeptember 12, 2012 at 6:52 PMgive me...

## Android

KaleshwariSeptember 17, 2012 at 11:50 AMI'm looking for Android interview Questions & Answers, For FRESHERS....

## java/j2ee

ranganathSeptember 27, 2012 at 5:46 PMplease send the inrerview questions.

## java,mobile computing

B.sirishaMay 9, 2013 at 12:27 PMis very good information give ours thank you

## java

ankan senguptaAugust 14, 2013 at 8:53 AMIn a global Mathematics contest, the contestants are told to invent some special numbers which can be built by adding the squares of its digits. Doing this perpetually, the numbers will end up to 1 or 4. If a positive integer ends with 1, then it is called the Number of Game. An example from above is: 13 = 1^2 + 3^2 = 1+9 = 10 (Step:1) 10 = 1^2 + 0^2 = 1+0 = 1 (Step:2), iteration ends in Step 2 since number ends with 1 Then in next round, the contestants are asked to combine their newly invented number, i.e. Number of Game with prime number. Now, being a smart programmer, write a program to help the contestants to find out the Nth combined number within any given range, where N can be any integer. Input Format: Input consists of 3 integers X, Y, N, one on each line. X and Y are upper and lower limits of the range. The range is inclusive of both X and Y. Find Nth number in range [X,Y]. Line 1 X,where X is the upper limit of the range Line 2 Y,where Y is the lower limit of the range Line 3 N,where Nth element of the series is required Constraints: X <= Y X > 0 N > 0 Output Format: Output will show the Nth element of the combined series lying in the range between X and Y. Line 1 For Valid Input,print U,where U is the Nth element of the combined number series lying in the range between X and Y. Or No number is present at this index For Invalid Input,print Invalid Input Sample Input and Output SNo. Input Output 1 1,30,3 19 2 12,33,5 No number is present at this index 3 -5,@,4 Invalid Input how to solve this question?

## JAVA

ARUMUGAMNovember 19, 2013 at 5:46 PMsir how to apply for java online exam sun certificate

Post your Comment