Answer:
if(y==10)
{
x=0; // assigning 0 to x if y equals 10.
}
else
{
x=1; // assigning 1 to x otherwise.
}
Explanation:
In the if statement i have used equal operator == which returns true if value to it's right is equal to value to it's left otherwise false.By using this operator checking value of y and if it is 10 assigning 0 to x and if it is false assigning 1 to x.
b. Heap sort
c. Merge sort
d. Quick sort
e. Selection sort
Answer:
a. Insertion sort
Explanation:
Insertion Sort is a sorting algorithm that places the input element at its suitable place in each pass.
Insertion sort is based on the idea that one element from the input elements is consumed in each iteration to find its correct position.
Answer:
// Here is code in C.
#include "stdio.h"
// create function to print all the combinations
void print_combi(char a,char b,char c)
{
// print all combinations of three characters
printf("%c%c%c %c%c%c %c%c%c %c%c%c %c%c%c %c%c%c\n",a,b,c,a,c,b,b,a,c,b,c,a,c,a,b,c,b,a);
}
// driver function
int main(void)
{
// create 3 char variable and initialize
char a='x',b='y',c='z';
// call the function
print_combi(a,b,c);
printf("\n");
// initialize with different character
a='1',b='2',c='3';
// call the function
print_combi(a,b,c);
printf("\n");
// initialize with different character
a='#',b='$',c='%';
// call the function
print_combi(a,b,c);
printf("\n");
return 0;
}
Explanation:
Create three char variables a, b, c. First initialize them with x, y, z. then call the function print_combi() with three parameters . this function will print all the combinations of those characters.We can test the function with different values of all the three char variables.
Output:
xyz xzy yxz yzx zxy zyx
123 132 213 231 312 321
#$% #%$ $#% $%# %#$ %$#
A C program to find all combinations of character variables:
void main ()
{
char f;
char s;
char t;
f = 'x';
s = 'y';
t = 'z';
System.out.print("" + f + s + t + " " + f + t + s + " " + s +f + t +
" " + s + t + f + " " + t + f + s + " " + t + s + f);
}
}
Answer:
a) 0.32%
b) 32%
c) Mbps WAN link is of more benefit
Explanation:
Average SNMP response message = 100 bytes
Avere message for each second when manager sends 400 SNMP
: 400 SNMP per second * 100 bytes = 40000 bytes per second = 40000Bps
To convert byte to bits, We have 1 byte = 8 bits
Therefore, 40000Bps = 40000 * 8 = 320 Kbps
a) Calculating the percentage of a 100 Mbps LAN link’s capacity
100 Mbps = 100000Kbps
320 Kbps is what percent of 100000Kbps = * 100 = 0.32%
So the resulting response traffic would represent 0.32% of a 100 Mbps LAN link’s capacity.
b) Calculating the percentage of a 1Mbps LAN link’s capacity
1Mbps = 1000Kbps
320 Kbps is what percent of 1000Kbps = * 100 = 32%
So the resulting response messages would represent 32% of a 1Mbps LAN link’s capacity.
c) When we are using the 1 Mbps WAN link, we use 32% of its speed to response the message as opposed to 100 Mbps LAN link that uses just 0.32%. This means the 1 Mbps WAN link uses more bandwith than the 100 Mbps LAN link. Therefore the management implication is that it is better to use the 1 Mbps WAN link has it has more benefits.
Answer:
var playerTurn;
var NUM_COLS;
var NUM_ROWS;
var SYMBOLS;
var tiles = [];
var checkWin = function()
{ };
var Tile = function(x, y)
{
this.x = x;
this.y = y;
this.size = width/NUM_COLS;
this.label = "";
};
Tile.prototype.draw = function()
{
fill(214, 247, 202);
strokeWeight(2);
rect(this.x, this.y, this.size, this.size, 10);
textSize(100);
textAlign(CENTER, CENTER);
fill(0, 0, 0);
text(this.label, this.x+this.size/2, this.y+this.size/2);
};
Tile.prototype.empty = function()
{
return this.label === "";
};
Tile.prototype.onClick = function()
{
// If the tile is not empty, exit the function
// Put the player's symbol on the tile
// Change the turn
};
Tile.prototype.handleMouseClick = function(x, y)
{
// Check for mouse clicks inside the tile
};
for (var i = 0; i < NUM_COLS; i++)
{
for (var j = 0; j < NUM_ROWS; j++)
{
tiles.push(new Tile(i * (width/NUM_COLS-1), j * (height/NUM_ROWS-1)));
}
}
var drawTiles = function()
{
for (var i in tiles)
{
tiles[i].draw();
}
};
mouseReleased = function()
{
for (var i in tiles)
{
tiles[i].handleMouseClick(mouseX, mouseY);
}
};
draw = function()
{
background(143, 143, 143);
drawTiles();
};
Explanation:
Answer:
He should remove any removable devices from the PC , change the boot device to USB or CD drive and insert the installation disk or a created ISO USB file to install
Explanation: