Answer:
// A optimized school method based C++ program to check
// if a number is composite.
#include <bits/stdc++.h>
using namespace std;
bool isComposite(int n)
{
// Corner cases
if (n <= 1) return false;
if (n <= 3) return false;
// This is checked so that we can skip
// middle five numbers in below loop
if (n%2 == 0 || n%3 == 0) return true;
for (int i=5; i*i<=n; i=i+6)
if (n%i == 0 || n%(i+2) == 0)
return true;
return false;
}
// Driver Program to test above function
int main()
{
isComposite(11)? cout << " true\n": cout << " false\n";
isComposite(15)? cout << " true\n": cout << " false\n";
return 0;
}
Explanation:
Answer:
7 bytes
Explanation:
<u>2 Address Instruction</u>
The 2 address instruction consist 3 components in the format.
One is opcode,other two are addresses of destination and source.
<u>Example-</u>
load b,c | Opcode destination address,source address
add a,d | Opcode destination address,source address
sub c,f | Opcode destination address,source address
Opcode consists of 1 bytes whereas destination address and source address consist of 3 bytes each.
(1+3+3) bytes=7 bytes
Answer:
Go for an interview before quitting your job.
Explanation:
You don't want to lose your job, do you? :)
Answer: Networking protocols are important as they define a set of rules to be used for exchanging information between computer nodes.
Explanation:
in terms of networking it is required for the source and the destination to have a set of predefined rules which enables the router to send and receive information across the network in such as way that both the ends are able to receive the messages.
The information exchange takes place first by the client by introducing itself to the remote server. the remote server upon receiving the information uses some form of handshaking and acknowledges the client of the receipt of the message.
besides this there are many routing protocols which tells us about the way how packets are sent from the client to the source. There are two types of routing protocols:
1. static routing protocols
2. dynamic routing protocols.
Relating to, using, or expressed in a system of numerical notation that has 2 rather than 10 as a base.