Answer:
DiffServ (Differentiated Service)
Explanation:
DiffServ (Differentiated Service) field is used to prioritize traffic in IPv4 packet.
DiffServ is used as QoS (quality of service) on networks at Layer 3, replacing former IPv4 TOS field to effectively deal with the web traffic and prioritization issues starting from 1998.
Answer:
System.out.println("October is the "+monthSales[9]+"th Month of the year");
A complete Java program is given in the explanation section.
Explanation:
public class num4 {
public static void main(String[] args) {
int [] monthSales = new int[12];
int i=0;
for(i = 0; i<monthSales.length; i++){
monthSales[i] = i+1;
}
System.out.println("October is the "+monthSales[9]+"th Month of the year");
}
}
In the code above, we created an an array of size 12 with this statement
int [] monthSales = new int[12];
using the for loop, the numbers 0-12 are added to the array corresponding to the twelve months in the year
The statement System.out.println("October is the "+monthSales[9]+"th Month of the year"); outputs the corresponding number to October
Answer:
Following are the program in python language
def prob3_6(k): #function definition
c = 0 #variable declaration
while k != 1: #iterating the while loop
print(k) #print k
if k % 2 == 0:#check if condition
k= k // 2 #divisible by 2
else: #else condition
k = k * 3 + 1
c = c + 1
print(k) #print k
print c #print count
prob3_6(3)#function call
Output:
3
10
5
16
8
4
2
1
7
Explanation:
Following are the description of program
- Create a function "prob3_6" in this function we passing an integer parameter of type "int" named "k".
- Inside that function we declared a variable "c" of type "int" that is used for counting purpose .
- After that we iterated the while for print the value of when it is not equal to 1 .
- We check if condition when k gives 0 on modulus then k is divisible by 2 otherwise else block will be executed in the else part we multiply by 3 to k and add 1 to the k variable .
- Finally print "k" and "c"
They where high ranking aristocrats in Russia during the 16th century. They where all executed.