import math
num1 = int(input("Enter a number: "))
num2 = int(input("Enter a number: "))
print(math.gcd(num1, num2))
The gcd() - greatest common divisor function, which is part of the math module works perfectly in this situation.
Answer: In operating system a code segment which accesses some shared variables or resources one at a time atomically such other no other code or process is accessing that resource or variable at the same time.
Entry section code block allows the access to the shared resource or variable and exit section code signals the termination from access to the shared resource or variable.
Explanation:
Entry and exit section codes needs to check certain properties before allowing the access and removal of access to a particular code segment.
These conditions are:
1. Bounded waiting.
2. Mutual exclusion.
3. checking thread execution status to allows other threads to enter the critical section (CS).
Answer:
We can protect the server from the modification by using the non root users in many ways as follows:
- By modifying the PHP settings in the server and by using the configured file as, the configuration of the file is basically depend upon the linux and the PHP script.
- By disabling the URL from the function of file handling that basically accept the local file as the parameters but it also accept the URL. It can even now get to outer destinations by utilizing fsockopen or any of the CURL capacities.
- The safe mode of PHP is presumably probably the best alternative to secure your server however it very well may be prohibitive. Whenever initiated, experimental mode averts access to records not claimed by Apache and access to condition factors and execution of double projects are likewise debilitated.