Académique Documents
Professionnel Documents
Culture Documents
4. input1="abc2012345"
input2="abc2112660"
input 3=4
here "abc20" refers to customer id and 12345 refers to the last month eb reading
and 12660 refers to this month eb reading
find the difference between 12660 and 12345 and multiply itr by input3
ie., output=(12660-12345)*4
Searchstring s1="GeniusRajkumarDev";
String s2="Raj";
String s3="Dev";
Return 1 if s2 comes before s3 in searchstring else return 2
-------manohar
1)
input
Searchstring s1="GeniusRajkumarDev";
String s2="Raj";
String s3="Dev";
Return 1 if s2 comes before s3 in searchstring else return 2
2) removing vowels in even position
intput=commitment;
output=cmmitmnt
3) count the number times the second word in second string occurs in first strin
g-case sensitive
input=hai hello hai where hai Hai;
input2=what hai
output=3;
4) return sum od non prime number
intput=9;
out put=1+4+6+8+9=28
-------steffie
1) input
Searchstring s1="GeniusRajkumarDev";
String s2="Raj";
String s3="Dev";
Return 1 if s2 comes before s3 in searchstring else return 2
2)
input1=130
input2=150
find the palindrom nos b/w the range and find the sum
output=272
3)
range 0-255
input=255.55.33.155
output = true
input=300.55.33.155
output = false
4) String a[]={"abx-23-78","des-90-12","ghi-45-23"};
find the sum of marks in each string.Find the max mark and find the correspondin
g name.
output:des
5) find if a charcter has repeated 3 consequetive times
input1:"aaabbccc"
ouput1=2;
----------swathi
1) input
Searchstring s1="GeniusRajkumarDev";
String s2="Raj";
String s3="Dev";
Return 1 if s2 comes before s3 in searchstring else return 2
2) reverse of a number
3)input={1,4,5,2,8,3}
find difference b/w adjacent numbers and return index of biggest number
8-2=6
output=index of 8
4) input="hai this is cognizant academy"
input2="hello this is a trainee"
find the occurance of the second word from the second string in the first strin
g
output=1
5) no of days b/w two dates
---------vasanth
1)input1="ABC2012333" (STRING) first five chars are consumer nos and next five
are units for current bill
input2="ABC2012444" (STRING) first five chars are consumer nos and next five
are units for current bill
INPUT3=4
(INT)
charge per unit
output= (input2-input1) * input3
output=(444-333)*4;
2)ID validation
3)compare two strings, if the characters in string 1 are present in
string 2, then it should be put as such in output, else '+' should be
put in output...ignore case difference.
input 1:"New York"
input 2:"NWYR"
output:N+w+Y+r+
-----------------------Brabanjana-------------------------1)
Searchstring s1="GeniusRajkumarDev";
String s2="Raj";
String s3="Dev";
Return 1 if s2 comes before s3 in searchstring else return 2
9)Input1:String (Rabbit)
Input 2:'-'
Insert the second char between each characters in the string after reversing
output:t-i-b-b-i-R
11) input={1,2,13,15,20,30}
input2=10;
sum the element and reverse the result;
output=87
-------------------vijay
1.
2.
3.
4.
STRING 1="---FALG----P-E"
STRING 2="---LOBD----K-I"
INDEX AND POSITION OF STRING 1 AND 2 "-" SHOULD BE SAME
DIFF BETWEEN 2 DATES(D1 AND D2) O/P IN MONTHS
LIST1={12,13,14,15,16};
LIST2={2,3,4,5,6};
CONDITION-INDEX-0---TAKE AS EVEN
O/P====EVEN INDEX OF LIST2,ODD INDEX OF LIST2EVEN INDEX OF LIST1
eg:{2,13,4,15,6}
STRING S="FLOWE.GIF"
O/P SHOUD BE EXTENSION OF FILE(eg:GIF)
----------------vijayan
1. In an integer array, each element should be raised to the power of
the index, and they should be added. the sum is the output.
eg:input{1,2,3,4}
output:1+2+9+64=76
2. validation of a time in hh:mm format...ignore case for am and pm
input:"9:25 am"-valid
"12:59 PM"-valid
"13:45 am"-invalid
3. sum of non prime numbers upto n
4.
Check if a string palindrome.Return 1 if the string is palindrome as wel
l as
it should have more than 1 unique vowels. else return -1
Eg: nayan is a palidrome but only 1 unique vowel 'a' return -1
Eg: naeyean return 1
5. input1=aaabbxxxc
output1=2
input1=abcd
output1=-1 have to count the character coming 2 or more consecutive time
s..
if true then return no of counts else -1
----------------ram_anna
1.input array={red,green,blue,ivory}
sort the given array
reverse the given array
if user input is 1 it should give oth element of an reversed array.
2.In a hash map<Integer,Float> get the average of all the values in a map and ro
----------Saranraj
1. return sum od non prime number
intput=9;
out put=1+4+6+8+9=28
2.check for the exact date format like dd/MM/yyyy
Input 1:12/06/2003
print--> 1
Input 2:12/6/2003
print-->-1
3.PAN CARD Validation
4.String Array should contain oly numbers !
Input 1={"12","12.35","one"}
output--->-1
Input 2={"12","12.35"}
output---->1
5.Take the word with a ma length in the given sentance in that check for vowels
if so count the no.of occurances !
Input 1="God is Great"
Output =2
Input 1="God is Greeat"
Output =3
------------sam
1.reverese the numbers
i/p = 13223
o/p = 32231
2.sum of Palindrome numbers between 2 limits (upper and lower), do not consider
single digit as palindrome.
If number is not palindrome return 0
ip1- 11
ip2 35
o/p-(11+22+33)-66
3. No repetiton of characters
i/p - hello world
o/p - helo wrd
4.In Hashmap, if the key value is divisable by 4 ,delete the key and values and
return a int value of the remaining count
ip1-{12,"hi"},{2,"world"}
op - 1
5. for the given string display the middle 2 value, case satisfies only if strin
g is of even length
ip - java
op av