In Progress

Write a C program

Write a C program that uses the fork() system call and creates a sequence in the child process based off of the Collatz conjecture (n= n/2 if even, 3 x n + 1 if odd). The first number in the sequence will be provided via a command line. An example would be if 8 were entered then the sequence would be 8, 4, 2, and 1. The parent process must use wait() so that the child process can output the sequence before exiting the program.

Some added conditions of the program are that it must fork two processes and print their respective Collatz conjecture. The first child sequence will be based on the command line input and the second child will be based on the first child’s command line input plus 3. The first input must be between 1-35 only. n will hold the command line input and it must be incremented by 3 in the parent process, not the child process. Also, do not create a new variable to hold the new value like m=n+3. The parent process must print out the value passed to each child. Each child should print out their name (1 or 2) with each number output. Each process must also print its own process ID (getpid() should be used twice at the start and right before execution). The program must run the forked processes concurrently. The wait call must be used twice.

Program must be written using the most basic methods, nothing advanced.

Skills: C Programming

See more: program c++ online, program c# online, program c++ freelance, different designs of church flex banner write up's made in nigeria, cannot run program c users leila appdata local android sdk tools android bat createprocess error 2 the system cannot find the fi, program c online, write a c program to accept 10 or more numbers then display the numbers in two columns one column with the numbers as they were , program c, freelance linux program c, c# write integration test for my sample program, c write integration test for my sample program, program read write image, program needs write, program read write file, simple program read write file, program will write external file

About the Employer:
( 1 review ) Mechanicworld, United States

Project ID: #11805241

Awarded to:

yamaf555

Hello,how are you? I have some experience in developing c++ programming And I can carry out your any proposal in time completely. I have mind to perform the task anytime. I look forward for working with you. I ho More

$25 USD in 1 day
(9 Reviews)
3.0

5 freelancers are bidding on average $18 for this job

$20 USD in 0 days
(1 Review)
0.6
SoumyadeepPal

A proposal has not yet been provided

$25 USD in 1 day
(0 Reviews)
0.0
fastwriter24

We are highly experienced Post Graduate Engineers, Doctors, IT, ITES, Software, Infrastructure Professionals, Web Designers and IT Architects. We can redo, improve, and publish any engineering, scientific MATLAB, S More

$10 USD in 1 day
(0 Reviews)
0.0
amariitism

Dear Sir Our team consists of 10 people and I am the Team Leader. We are highly supportive to the employer.  We are approachable, you can come to us if you have a struggle, we are very to help.   Expertise:-  Virtu More

$20 USD in 1 day
(0 Reviews)
0.0
thinkitltd4

i can do youir work only 2 hour.........................................................................................................................

$15 USD in 1 day
(0 Reviews)
0.0