Answer:
Protocol
A network protocol is an established set of rules that determine how data is transmitted between different devices in the same network. Essentially, it allows connected devices to communicate with each other, regardless of any differences in their internal processes, structure or design. Network protocols are the reason you can easily communicate with people all over the world, and thus play a critical role in modern digital communications.
Answer:
- Step1: Check If the number is Positive or Negative.
- Step2: If it is positive then save the sign of it as 0.
- Step3: If it is negative then save the sign of it as 1.
- Step4: Covert the negative number to Positive.
- Step5: Convert the IEEE 754 to Binary.
- Step6: convert the integer part into binary form
- Step7: Convert fractional part into binary form
- Step8: To convert Integer part, Devide the number by 2 and note down the reminder and Keep deviding unless dividend is less than 2
- Step9: copy all the reminders together
- Step10: Multiply decimal part by 2 unless fractional part is 0.
- Step11: By noting down integral part, keep multiplying decimal part by new value of 2 untill perfect number is reached.
- Step6: Find the Mantissa.
- Step7: Concatinate the Sign, exponent and the mantissa.
Explanation:
For Example : 20.75
First step (converting 50 (in base 10) to binary):
- No is Positive
- By dividing 20 by 2, which gives 10 with no remainder 0.
- Now Devide 10 by 2, which gives 5 with a remainder of 0.
- Now Devide 5 by 2, which gives 2 the reminder as 1
- Now Devide 2 by 2, which gives 1 with reminder as 0
- Now devide 1 by 2, which gives 0 with reminder as 1
- We read the result from bottom to top which is 10100
Second part is to convert 0.75 to binary:
- We have to multiply 0.75 by 2, which gives 1.5. We keep only the integer part, which is 1.
- Now, we do 1.5 - 1, which gives 0.5. Now, We multiply 0.5 by 2, which gives 1.
- Now we do 1 - 1, which gives 0.
- Reading from Top to bottom will give 110
Final Answer is : 10100.110
Answer:
Program is written in C++
#include<iostream>
using namespace std;
int main()
{
//1. Prime Number
int num;
cout<<"Input Number: ";
cin>>num;
int chk = 0;
for(int i =2; i <num;i++)
{
if(num%i==0)
{
chk = 1;
break;
}
}
if(chk == 0)
{
cout<<num<<" is prime"<<endl;
}
else
{
cout<<num<<" is not prime"<<endl;
}
//2. Greatest Common Factor
int num1, num2, x, y, temp, gcf;
cout<<"Enter two numbers: ";
cin>>num1;
cin>>num2;
x = num1;
y = num2;
while (y != 0) {
temp = y;
y = x % y;
x = temp;
}
gcf = x;
cout<<"Greatest Common Factor: "<<gcf<<endl;
// 3. LCM
cout<<"Enter two numbers: ";
cin>>num1;
cin>>num2;
x = num1;
y = num2;
while (y != 0) {
temp = y;
y = x % y;
x = temp;
}
gcf = x;
int lcm =(num1 * num2)/gcf;
cout<<"Least Common Multiple: "<<lcm<<endl;
return 0;
}
Explanation:
<em>I've added the full source code as an attachment where I make use of comments to explain some lines</em>
A. Assets increase, and liabilities decrease.