Questions


1)Write a Program for the given input string and the output should be as given below ?

  Input    : "132141567643"
  Output : 13:21:41:56:76:43





_______________________________________________________________________________

2)Write a Program to set all bits in an integer which are right to the left most set bit ?

Input    :  8  (0000 0000 0000 1000)
Output :  15(0000 0000 0000 1111)




_________________________________________________________________________________

3)Write a Program for Data Encoder Application ?

Input   :"Abbcddd eef ghhhijjj aabbc, omg"
Output:1A2b1c3d 2e1f 1g3h1i3j 2a2b1c, 1o1m1g



_________________________________________________________________________________

4)Write a Program to count the same positions if the string is reverse and compare with original
    string ?

Input  :  alphxxdida
Output :4



_________________________________________________________________________________

5)Write a Program to sort n elements in ascending order and remaining elements in descending
   order?
  n-> for sorting in Ascending order

Input 1 : 11 7 5 10 46 23 16 8
Input 2 n : 3
Output :5 7 11 46 23 16 10 8



________________________________________________________________________________

6)Write a  Program to remove all the characters in second string which are present in
    first string ?

  Input 1: ramesh
 Input  2: suresh
 Output :us


_________________________________________________________________________________

7)Write a Program to reverse the words in line from given input line ?

Input    : Golconda fort located in Hyderabad
Output : Hyderabad in located fort Golconda



________________________________________________________________________________

8)Given an array,sort the zeros from non zeros ?

 Input   : 1 2 0 0 7 4  4 2 0 0 0 6
 Output: 1 2 7 4 4 3 6 0 0 0 0 0

_________________________________________________________________________________

9)Given two Integers L and R.Determine the Bitwise OR of all the integers in the
    range[L,R](both inclusive)

 Input 1   :L=3 R=8
 Output 1:15

Input 2 :L=12 R=18
Output : 31


_______________________________________________________________________________

10)Write a program to swap first and last word of given string if both the word having
       equal length ?

  Input   : the link is tie
  Output: tie link is the



________________________________________________________________________________

11)Write a program for the following input and output ?

Input   : technical information exchange
Output: lacinhcet noitamrofni egnahcxe



_________________________________________________________________________________

12)Write a Program to insert two extra elements in given array,increment first element by one
      and insert before it and decrement last element by one and insert after it using function ?

 Input    : 10 20 30 40 50
 Output :11 10 20 30 40 50 49



______________________________________________________________________________

13)Write a program for the following input and output ?

Input    : world changed your thoughts
Output : sthguoht ruoy degnahc dlrow



_________________________________________________________________________________

14)A window of size k is sliding from left to right in an array of size n,find the maximum number
      in the window at each window position ?

Input    : arr[]={1,2,3,1,4,5,2,3,6} ,k=3
Output : 3 3 4 5 5 5 6


________________________________________________________________________________

15)Write a program to convert number into words ?

Input    :  1234
Output : one thousand two hundred thirty four


_________________________________________________________________________________