Answer:
monitor fileSharer
{
enum {THINKING, WAITING, READING} state[N];
condition self[N];
int total;
void open(int i) {
state[i] = WAITING;
if (i + total >= N)
{ self[i].wait(); } // Leaves monitor
state[i] = READING;
total += i;
}
void close(int i) {
state[i] = THINKING;
total -= i;
// Can signal one waiting proc whose ID won't break bank.
for (int x = N - total - 1; x >= 0; x--) {
if (state[x] == WAITING) {
self[x].signal(); break;
}
}
}
initialization.code() {
for (int i = 0; i < N; i++) {
state[i] = THINKING;
}
total = 0;
}
}
Answer:
Program:
The below program in c-language
int main()// main function
{
float a,b; //variable declaration //1
a=4.89,b=6.9;// assign the value//2
printf("%f",b/a);// statement to display the fraction value.//3
return 0;// return statement.
}
Output:
1.411043
Explanation:
The fraction value is a value that comes when a number is divided with another number. The description of the statement which used in the above program is as follows--
- Defined a"main" function that needs to starts the execution.
- Declare a two-variable "a" and "b" of type "float" and assign the value on its.
- This statement is used to display the fraction of value on the screen in which the "print()" function is used to display the value and "%f" is used to display the float type value and "b/a" is used to calculate the fraction.
Answer:
4, 2
Explanation:
for numx in [3, 4]:
for numy in [1, 2]:
print (numx, numy)
make sure to indent properly
The answer is entrepreneurial and bureaucratic. Organizations
that are large and small can achieve higher sales and other profit by properly
matching their needs with the structure they use to operate. the structure of an organization can help or
hinder its progress toward accomplishing these goals and This are specific set
up of organizations and ways to accomplish different goals.