Skip to main content

Posts

ADJUST RESOLUTION IN VM WARE

I was installing Debian on VMware and there encountered a problem with the resolution of the OS using it virtual. The resolution of the Display was not matching with the resolution of the screen, which was 1920x1080. I checked the Display application of Debian, not much use, I found. Then to the resolutions in the Virtual Machine Settings, again no much improvement. After going through the  xrandr  command of Debian, it was found helpful. Copy the following lines of commands and paste it in a file with .sh extension and save it in any Directory, to make it ease put it in the Desktop. xrandr --newmode "1920x1080"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync xrandr --addmode Virtual1 1920x1080 xrandr --output Virtual1 --mode 1920x1080 I have used 1920x1080 because that was my system resoluton. You can replace the value by the value which you would like to have your screen adjusted to. Now, open the Terminal and type in the command to change...

PROBLEM SHEET 2

This problem sheet was created by Sir Narasimhan T, Assistant Professor, IT Department LBS College of Engineering, Kasaragod. The softcopy in .pdf is available  here . There is something much more in the file. 1) Predict the output of the following code snippets. Clearly specify the reasons for your answer. a) main() {     float a = 0.7;     printf("%d %d", sizeof(a),sizeof(0.7)); } b) main() {     float expr = 2.0;     switch (expr)     {         case 1.0: printf("One\n");         case 2.0: printf("Two\n");         default: printf("Default\n");     }    } 2) A character is entered through the keyboard, write a program to determine whether the character entered is a capital letter, a small case letter, a digit or a special symbol. The following table shows t...

PROBLEM SHEET 3

This problem sheet was created by Sir Narasimhan T, Assistant Professor, IT Department LBS College of Engineering, Kasaragod. The softcopy in .pdf is available  here . There is  a bit more in the file. 1)A generalized Fibonacci sequence is a sequence of numbers such that from the third number onwards, each number is the sum of preceding two numbers. An example of generalized Fibonacci sequence is: 2, 5, 7, 12, 19, · · · · · · , but 1, 2, 3, 4, · · · · · · is not. You are to write a program that, given a sequence of numbers, decides whether the sequence is a generalized Fibonacci sequence or not. 2)There are 500 light bulbs (numbered 1 to 500) arranged in a row. Initially they are all OFF. Starting with bulb 2, all even numbered bulbs are turned ON. Next, starting with bulb 3, and visiting every third bulb, it is turned ON if it is OFF, and it is turned OFF if it is ON. This procedure is repeated for every fourth bu...

PROBLEM SHEET 4

This problem sheet was created by Sir Narasimhan T, Assistant Professor, IT Department LBS College of Engineering, Kasaragod. The softcopy in .pdf is available  here . There is  a bit more in the file. 1)Write a program to reverse the contents of an 1D array without using a second array. 2)Assume that an integer array contains duplicate entries. Find the mode of this array. Mode is that element that occurs the most number of times. A sample input and output is shown below: Enter array size 7 Enter 7 elements 2  1  -1  2  -1  4  -1 The mode is  -1 3)Rotate an array r times. Print the array after each rotation. A sample input and output is shown below. Enter the array size 5 Enter the elements 10 7 8 25 16 How many times you want to rotate? 3 Array after rotation 1 16 10 7 8 25 Array after rotation 2 25 16 10 7 8 Array after rotation 3 8 25 16 10 7 4)An election is contested by 5 candidates whose symbols are @, #, $, % and...

PROBLEM SHEET 4

This problem sheet was created by Sir Narasimhan T, Assistant Professor, IT Department LBS College of Engineering, Kasaragod. The softcopy in .pdf is available  here . There is  a bit more in the file. 1)Write a program to reverse the contents of an 1D array without using a second array. 2)Assume that an integer array contains duplicate entries. Find the mode of this array. Mode is that element that occurs the most number of times. A sample input and output is shown below: Enter array size 7 Enter 7 elements 2  1  -1  2  -1  4  -1 The mode is  -1 3)Rotate an array r times. Print the array after each rotation. A sample input and output is shown below. Enter the array size 5 Enter the elements 10 7 8 25 16 How many times you want to rotate? 3 Array after rotation 1 16 10 7 8 25 Array after rotation 2 25 16 10 7 8 Array after rotation 3 8 25 16 10 7 4)An election is contested by 5 candidates whose symbols are @, #, $, % and...

PROBLEM SHEET 5

This problem sheet was created by Sir Narasimhan T, Assistant Professor, IT Department LBS College of Engineering, Kasaragod. The softcopy in .pdf is available  here . There is  a bit more in the file. 1) Calculate the mean, variance and standard deviation of a set of numbers. 2) A m × n matrix M is said to have a saddle point if there is an entry M[i][j] such that it is the smallest value in row i and the largest value in column j. For example, consider the matrix: 20   30   40 56   78   45 1   2   3 Here 45 is the saddle point because it is the smallest in row1 but largest in column2. Given a matrix, find the saddle point if it exists. 3) Determine the norm of a matrix. Norm is defined as the square root of the sum of the squares of matrix elements. A sample input and output is shown below: Enter the size of matrix 2  3 Enter 6 elements 1  2  3  4  5  6 The matrix is 1...

Solutions of Game-"Hacked"

Here comes the solutions of various levels of the game "Hacked". Its available in Android Play Store- The first coding game on smart phones. Solutions for various levels and corresponding sub levels are given below which can be referred if needed. Go, enjoy the game. THE HACKPAD Increment me input + 1 Positive input > 0; Absolute if input < 0 {      return -input; } return input; Absolute 2 abs(input); HIGH SCHOOL HACK Power while var_a < input {      var_b = var_b + input;      var_a++; } return var_b; Power 2 pow(input,2); Length foreach var_a in input{      var_b++; } return var_b; Push it var_a = []; while var_b < input {      var_a.push(var_b);      var_b++; } return var_a; JAIL BREAK Max foreach var_a in in...