info@meritcampus.com    +91-85006-22255
...
`

### Weekend Hack - 12 Jan 2013 - Rs. 200 has these questions

Floating point variables conversion109

What will be the output of the following program?
`class FloatConversion{    public static void main(String args[])    {        int i = 44;        float f = 98.42f;        double d = 103.67;                f = i;        d = f;        i = (int) d;        System.out.println("i = " + i);        System.out.println("f = " + f);        System.out.println("d = " + d);    }}`
 A. i = 44f = 44.0d = 44.0 B. i = 103.67f = 44d = 98.42 C. i = 44f = 44d = 44 D. i = 44.0f = 44.0d = 44.0

Find if the word present in character matrix BiDirectional

Write a program to find if the word is present in the character matrix in any direction. The directions are horizontal, vertical, upward diagonal, downward diagonal and their opposite directions.
Input (char[][], String) Output (Boolean)
`B A T CT O P CX Y Z WA C W Zsearch word = TOP` true
`B A T CT O P CX Y Z WA C W Zsearch word = POT` true
`Q E AR M IX Y Zsearch word = MAT` false
`Q E A D RB E G J IW Z A L NX V M S UC J O P Tsearch word = EAST` true
`Q E A D RB T G J IW Z S L NX V M E UC J O P Tsearch word = TEST` true
`Q E AR M NX Y Tsearch word = ANT` true
`Q E NR M EX Y Tsearch word = TEN` true
`Q E A D MB T G E IW Z R L NX I M E UT J O P Tsearch word = MERIT` true
`Q E A D NB T G A IW Z V L NX A M E UR J O P Tsearch word = RAVAN` true
``` class FindWordPresentInCharacterMatrixBiDirectional {    public static void main(String s[])    {        char[][] input = {{'A', 'S', 'C', 'D'}, {'C', 'T', 'A', 'F'}, {'Q', 'M', 'A', 'S'}, {'V', 'X', 'Z', 'C'}};        System.out.println("CAT is present : " + isWordIsPresentInMatrix(input, "CAT"));    } public static boolean isWordIsPresentInMatrix(char[][] matrix, String searchWord) { //Write code here to find if the word is present in the given matrix. } //Write code here if we want create any new methods. } ```