Perform necessary error checking to ensure that a positive

Assignment Help Operating System
Reference no: EM13312311

3.21 The Collatz conjecture concerns what happens when we take any positive integer n and apply the following algorithm: 

n = n/2, if n is even 3 × n + 1, if n is odd The conjecture states that when this algorithm is continually applied, all positive integers will eventually reach 1. For example, if n = 35, the sequence is 35, 106, 53, 160, 80, 40, 20, 10, 5, 16, 8, 4, 2, 1 

 , if 8 is passed as a parameter on the command line, the child process will output 8, 4, 2, 1. Because the parent and child processes have their own copies of the data, it will be necessary for the child to output the sequence. Have the parent invoke the wait() call to wait for the child process to complete before exiting the program. Perform necessary error checking to ensure that a positive integer is passed on the command line.

Reference no: EM13312311

Questions Cloud

Explain how to estimate the diameter of the small pipe : Fluid flows steadily, at a volume rate Q, through a large pipe and then divides into two small pipes, the larger of which has an inside diameter of 25 mm and carries three times the flow of the smaller pipe.
Explain how many of the potential alkyl halide products : A variety of different products could be formed in this reaction; for this problem assume all unique products are formed that only 1 Br is present in each alkyl halide product. how many of the potential alkyl halide products would have at least on..
Compute the magnitude of the load changes in length : A brass alloy has a yield strength of 280 MPa, a tensile strength of 390 MPa, and an elastic modulus of 105 GPa. A cylindrical specimen of this alloy 12.7 mm in diameter and 250 mm long is stressed in tension and found to elongate 7.6 mm
Determine what is the final weight in pounds and newtons : A container weights 2.06lb. It is filled with 1.09ft^3 of water at 25 degrees Cel. What is the final weight in pounds and newtons
Perform necessary error checking to ensure that a positive : Write a C program using the fork() system call that generates this sequence in the child process. The starting number will be provided from the command line. For example
Find the maximum height of the ball above the ground : You throw a 5-kg ball from a platform releasing the ball at a height of 5 meters with a speed of 10m/s at an angle of 30 degrees with respect to the horixontal. Find the maximum height of the ball above the ground
Determine the deflection in degree for horizontal wind speed : Determine the deflection in degrees for horizontal wind speed of 10m/s and what is the magnitude of the force required at the bottom of the sign to prevent the sign from deflecting
Iso standards apply to riordan manufacturing : Identify which ISO standards apply to Riordan Manufacturing
What will be the new angular velocity : Your 70kg friend is standing on the outer edge of a merry go round with moment of inertia 695kg*m^2, what will be the new angular velocity

Reviews

Write a Review

Operating System Questions & Answers

  Implementation of algorithms for process management

The Shortest Job Next (SJN) algorithm queues processes in a way that the ones that use the shortest CPU cycle will be selected for running rst.

  Develop a user mode command interpreter

Develop a user mode command interpreter which support list-short.

  Memory allocation in operating system

Analysis and implementation of algorithms for memory allocation in operating system, Explain First- t and best- t methods are used in memory allocation in operating systems.

  Stand alone child process

Forking the child process

  Write a multi-threaded program

Write a multi-threaded program to solve producer and consumer problem

  Marginal and average cost curves

n a competitive market place (pure competition) is it possible to continually sell your product at a price above the average cost of production.

  Simulating operating systems scheduling

Simulate the long-term scheduler, the short-term scheduler and the I/O scheduler of the computer using the First-Come-First-Serve algorithm.

  Issues with trusted platform module

Research paper discussing the issues with Trusted Platform Module (TPM)

  Threads

Explain a complication that concurrent processing adds to an operating system.

  Design and programming

Use the semaphore methods to control the concurrency of the solution

  Virtual machines

Virtual machines supported by a host operating system

  Discuss an application that benefits barrier synchronization

Discuss an application that would benefit from the use of barrier synchronization

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd