Answer:
#include <iostream>
using namespace std;
void divide(int numerator, int denominator, int *quotient, int *remainder)
{
*quotient = (int)(numerator / denominator);
*remainder = numerator % denominator;
}
int main()
{
int num = 42, den = 5, quotient=0, remainder=0;
divide(num, den, "ient, &remainder);
return 0;
}
Explanation:
The exercise is for "Call by pointers". This technique is particularly useful when a variable needs to be changed by a function. In our case, the quotient and the remainder. The '&' is passing by address. Since the function is calling a pointer. We need to pass an address. This way, the function will alter the value at the address.
To sum up, in case we hadn't used pointers here, the quotient and remainder that we set to '0' would have remained zero because the function would've made copies of them, altered the copies and then DELETED the copies. When we pass by pointer, the computer goes inside the memory and changes it at the address. No new copies are made. And the value of the variable is updated.
Thanks! :)
Enviromental technology can be listed from simple objects to a large company.
1.Enviromental Technology:
Wood farming (its not that of a technology, but the amount technology to do this is large)
2.Coal Mining
3. Water damps (for making electricity)
alright.. good:
1. other objects can be created thanks to this
2. The final product can be used as a source of energy.
3. Electricity!!
the bad.
1. mass-cutting trees... :(
2. Often makes no to some pollution, can have pernament effect on the workers life (respiratory problems etc.)
3. Can cause floods..
Answer:
A lookaside buffer translation (TLB) is a memory cache that reduces the time it takes to access a user memory place. TLB includes the most lately used page table entries.
TLB is used to overcome the issue of sizes at the time of paging. Page Table Entry (PTE) is used for framing the memory ,but it uses two references one for finding the frame number
and the other for the address specified by frame number.
<u>Formula for finding effective memory access time-</u>
Effective Memory Access Time = (TLB access_time+Memory Access Time)*hit ratio + (TLB access_time+2*Memory Access Time)*(miss ratio)
Given in question,
Hit ratio = 0.90
Memory Access Time = 150ns
TLB access time= 5ns
Effective Memory Access Time = (TLB access_time+Memory Access Time)*hit ratio + (TLB access_time+2*Memory Access Time)*(miss ratio)
=(5+150) * 0.90 + (5+2*150)*(1-0.90)
=155 * 0.90 + (305*0.1)
=139.5 + 30.5
= 170ns
All tables are composed of horizontal rows and vertical columns, with small rectangles called cells in the places where rows and columns intersect. In Access, rows and columns are referred to as records and fields. A field is a way of organizing information by type.