answer:
(i) #include <iostream>
using namespace std;
int main() {
int n1,n2,max;
cin>>n1>>n2;
if(n1>n2)//finding maximum between n1 and n2 in the program directly.
max=n1;
else
max=n2;
cout<<max;
return 0;
}
(ii)
#include <iostream>
using namespace std;
int maximum(int n1 ,int n2)
{
if(n1>n2)//finding maximum between n1 and n2 using function.
return n1;
else
return n2;
}
int main() {
int n1,n2,max;
cin>>n1>>n2;
max=maximum(n1,n2);
cout<<max;
return 0;
}
(iii)
#include <iostream>
using namespace std;
inline int maximum(int n1 ,int n2)
{
return (n1>n2)? n1:n2;
}
int main() {
int n1,n2,max;
cin>>n1>>n2;
max=maximum(n1,n2);//Finding maximum using inline function.
cout<<max;
return 0;
}
Output:-
54 78
78
all three codes give the same output.
Explanation:
In part (i) I have done the operation in the main function directly.
In part(ii) I have used function to calculate the maximum.
In part(iii) I have used inline function to calculate maximum.
Answer:
Explanation:
Bit: A bit (short for binary digit) is the smallest unit of data in a computer. A bit has a single binary value, either 0 or 1.
Byte: A byte is a data measurement unit that contains eight bits, or a series of eight zeros and ones.
Kilobyte: A KB (kilobyte) is 1000 bytes.
Megatype: An MB (megabyte) is 1000 kilobytes.
Gigatype: A GB (gigabyte) is 1000 megabytes.
Terabyte: A TB (terabyte) is 1000 gigabytes.
hope this helped you!
<span>Truth tables are diagrams used in mathematics and logic to help describe the truth of an entire expression based on the truth of its parts.
A truth table shows all the possible combinations (outputs) that can be produced from the given inputs. They are mainly used in Boolean algebra.</span>
It can be noisy and distracting to students to listen to audio speakers when there are multiple computers in the classroom. Headphones help the students