Answer:
4
Explanation:
The loop is used to execute the part of code or statement again and again until a condition is not true.
syntax of for loop:
for(initialize; condition; increment/decrement){
statement;
}
in the question, the value of n is zero.
then, for loop check the condition k<2, initially the value of k is zero. so, the condition is true and execute the code n = 0 +2=2
Then, k is increment by 1. so, the value of k is 1.
then, again loop run and check the condition 1<2, it true. then n = 2+2=4.
then, k is increment by 1. so, the value of k is 2.
Then, again check the condition 2<2, condition false and program terminate the loop and finally print the value 4.
I believe it is the first one, i did some research for this question
Answer:
a. DHCP
Explanation:
DHCP stands for Dynamic Host Configuration Protocol.
DHCP server basically holds and provides every host with IP addresses or necessary configuration on the network so that the hosts can communicate. This is done automatically. This server configures the hosts on the network and without this server this configuration has to be done manually.
DHCP server can be a server or router and its advantage is that it minimizes the risk of IP conflicts. Sometimes the range of the IP addresses can be changed or new IP addresses are assigned. DHCP server can store this new information related to the configuration and transfers this information to other end points too.
Answer:
In C++:
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
void printarray(int array []){
for(int i=0; i<100; i++){ cout << array[i] << " "; }
}
void sortarray(int array []){
sort(array, array + 100);
printarray(array);
}
int main() {
int array[100];
srand((unsigned)time(0));
for(int i=0; i<100; i++){ array[i] = (rand()%99); }
printarray(array);
cout<<endl;
sortarray(array);
return 0;
}
Explanation:
<em>See attachment for program source file where comments are used for explanation purpose</em>