Answer: The internet protocol (IP) stack consist of the five layers and their functioning which are as follows:-
- Application layer:- this layer is responsible for the type of service that is operating the system.It uses protocols like SMTP(Simple mail transfer protocol, FTP(file transfer protocol) etc.
- Network layer:-this layer is used for the routing and transmission of the data packets through the routes. The exchange of IP packets is done between the server and the client.
- Transport layer:-It uses the protocols TCP(Transmission control protocol) and UDP(User datagram protocol)for splitting the message and sending it to the recipient's address.
- Data link layer:-it uses the point-to-point protocol for the sending the message from node to node.It also handles the data while inputting and outputting of the physical network.
- Physical layer:-The working is done in a frame in which the the bits present in one node is transferred to other. It is used for defining the physical parameters like cables, etc.
Answer:
11011011
00000000
Explanation:
10022011 cant be an answer because bits are composed of 0s and 1s
and 11100 is too small.
Answer:
The solution code is written in Java.
- public static void swapArrayEnds(int myArray[]){
- int lastIndex = myArray.length-1;
- int temp = myArray[0];
- myArray[0] = myArray[lastIndex];
- myArray[lastIndex ] = temp;
- }
Explanation:
First create the swapArrayEngs method that take one input array parameter (Line 1).
Since we need to swap the first and last element of the array, we need to get the first index and last index of the array. The first index is 0 and the last index can be calculated by subtracting the length of array from 1 (Line 2).
Next, we can create a temp variable to hold the value of the first element (Line 3). Then we use the lastIndex the get the value of last element and assign it to the first element of array (Line 4). Lastly, we assign the temp (holding the initial first element value) to the last element of array (Line 5).
Answer:
Following are the program in the Python Programming Language.
#import the random package to generate random number
import random
#declare variables and initialize to 10 and 0
num = 10
count=0
#set for loop
for i in range(1,num):
#set variable that store random number
n = random.randint(0,5);
#set if conditional statement
if(n==4):
#print count and break loop
print("Count:%d"%(count))
break
#increament in count by 1
count+=1;
<u>Output</u>:
Count:4
Explanation:
<u>Following are the description of the program</u>.
- Firstly, import required packages and set two variable 'num' initialize to 10 and 'count' initialize to '0'.
- Set the for loop that iterates from 1 to 9 and inside it, set variable 'n' that store the random number, set if conditional statement inside it print the count and break the loop and increment in count by 1.
I cant be taking these pills when im in thethey say i be cappin a lot