Answer:
// here is code in c++.
// include header
#include <bits/stdc++.h>
using namespace std;
// main function
int main()
{
// variables to read input
int userNum,x;
cout<<"enter the value of userNum and x :";
// read the input from user
cin>>userNum>>x;
// divide the userNum with x 4 times
for(int a=0;a<4;a++)
{
userNum=userNum/x;
cout<<userNum<<" ";
}
cout<<endl;
return 0;
}
Explanation:
Declare two variables "userNum" and "x". Read the value of these. Run a for loop 4 time and divide the "userNum" with "x" and print the value of "userNum".
<u>Output:</u>
enter the value of userNum and x :2000 2
1000 500 250 125
The distinction between "computer architecture" and "computer organization" has become very fuzzy, if no completely confused or unusable. Computer architecture was essentially a contract with software stating unambiguously what the hardware does. The architecture was essentially a set of statements of the form "If you execute this instruction (or get an interrupt, etc.), then that is what happens. Computer organization, then, was a usually high-level description of the logic, memory, etc, used to implement that contract: These registers, those data paths, this connection to memory, etc.
Programs written to run on a particular computer architecture should always run correctly on that architecture no matter what computer organization (implementation) is used.
For example, both Intel and AMD processors have the same X86 architecture, but how the two companies implement that architecture (their computer organizations) is usually very different. The same programs run correctly on both, because the architecture is the same, but they may run at different speeds, because the organizations are different. Likewise, the many companies implementing MIPS, or ARM, or other processors are providing the same architecture - the same programs run correctly on all of them - but have very different high - level organizations inside them.
In a parallel connection, the voltage is same in every branch.
Now, three <span>three resistors connected in parallel.
R1 = 2k ohm
</span>R2 = 6k ohm
R3 = 10k ohm
in parallel, net resisitance =
Now, putting the values, we get, R net = 1.30 k ohm.
Ans, voltage = 100 VDC
Thus, power =
= 7.69 Watt
Answer:
Explanation:
Algorithm:
a. In each day, you will have to loop through the hotels that come to the hotel after you stayed last night.
b. If a hotel 'h' is found at more than 'd' distance away from last stayed hotel, then the hotel previous of 'h' is chosen to wait for that night. This is the greedy step, and you stay in this hotel.
c. The process for steps a and b is then repeated until we've reached the last hotel xn.
Running time:
Notice that the worst case occurs if each hotel is at a distance of successive multiples of 'd'. The best move is to estimate the distance to each hotel twice the whole computation in the scenario.
Thus, the total running time that could occur in the worst case is O(2n) = O(n). This is said to be linear time.