Find Jobs
Hire Freelancers

C programs

$10-20 USD

Completed
Posted over 8 years ago

$10-20 USD

Paid on delivery
Please give the Source Code for the following programs: 1. The Collatz conjecture concerns what happen when we take any positive integer n and apply the following condition:- if the entered value " n" is even then, n=n/2 (or) if the entered value "n" is odd then, n=3*n+1 Write a C program using fork() system call that generates the sequence in the child process. The starting number will be provided from the command line. For example if 35 is entered, the sequence must be 35, 106,53,160,80,40,20,10,5,16,8,4,2,1. Because the parent and child process have their own copies of 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. A positive integer must be passed form the parameter. 2. In the previous question, the child process must output the sequence of numbers generated form the algorithm specified by the Collatz conjecture because the parent and child have their own copies of the data. Another approach to designing this program is to establish a shared memory object between the parent and child process. This technique allows the child to write the contents of the sequence to the shared memory [login to view URL] parent can then output the sequence when the child completes. Because the memory is shared, any changes the child makes will be reflected in the parent process as well. This program will be structured using the shared memory technique. The parent process will progress through the following steps: a. Establish the shared memory object (shm open(), ftruncate(), and mmap()) b. create the child process and wait for it to terminate. c. Output the contents of shared memory. d. Remove the shared memory object. In this exercise, the parent and child processes must be coordinate so that the parent does not output the sequence until the child finishes execution. These two process will be synchronized using the wait() system call: the parent process will invoke(), which will suspend it until the child process exits. In summary, child will create shared memory and the output is entered into it and the parent will access this data and displays. 3. Write a multi threaded program that calculates various statistical values for a list of numbers. This program will be passed a series of numbers on the command line and will then create three separate worker threads. One thread will determine the average of the numbers, the second will determine the maximum value and the third will determine the minimum value. For example if the passed integers are:- 90, 81, 78, 95,79,72,85 then the output will report as The average value is 82 The minimum value is 72 The maximum value is 95 The variables representing the average, minimum and maximum values will be stored globally. The worker threads will set these values and the parent thread will output the values once the worker have exited. 4. Write a multi thread program that generates the Fibonacci Sequence. This program works as : On the command line, the user will enter the number of Fibonacci numbers that the program is to generate . The program will then create a separate thread that will generate the Fibonacci numbers, placing the sequence in data that can be shared by the threads (an array is probably the most convenient data structure). When the thread finishes execution, the parent thread will output the sequence generated by the child thread. Because the parent thread cannot begin outputting the Fibonacci sequence until the child thread finishes, the parent thread will have to wait for the child thread to finish. For eg:- If we provide input as 6 then we need to get 6 values which means 0,1,2,3,5,8
Project ID: 8601479

About the project

16 proposals
Remote project
Active 9 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
Dear, I have done work on this and can give you task as early as you need. Regards, Jawwad
$30 USD in 1 day
3.2 (1 review)
0.6
0.6
16 freelancers are bidding on average $55 USD for this job
User Avatar
Hello I'm interesting your project very well I'm a Good C/C++, Math, Algorithm expert. I understand your req exactly. I m quite well experienced in these jobs. Let's go ahead with me I want to service for you continously. Thanks
$55 USD in 1 day
4.9 (422 reviews)
8.4
8.4
User Avatar
A proposal has not yet been provided
$39 USD in 1 day
5.0 (32 reviews)
5.2
5.2
User Avatar
Hello, I have 30 years experience programming in C. I can use multi-programming (using forks or threads) and shared memory for these exercises. A milestone payment for the full budget for this project must be deposited with this site before your offer can be accepted. Alan Idler Chief Software Architect Idleswell Software Creations
$160 USD in 3 days
4.8 (65 reviews)
5.1
5.1
User Avatar
La propuesta todavía no ha sido proveída
$66 USD in 1 day
5.0 (9 reviews)
4.6
4.6
User Avatar
A proposal has not yet been provided
$45 USD in 3 days
4.7 (18 reviews)
4.9
4.9
User Avatar
Hello. More 20 years programming experience. I need more details to set real time and price. Regards. ---------------------------------------------------------------------------------------------------------------------------------------------------
$100 USD in 3 days
4.8 (12 reviews)
4.4
4.4
User Avatar
Hi.I am a Software Engineer and programmer. I have about 2 years of programming experience and developed 52 project .Project are both web based and desktop based application. I am ready to start your project right now. If you have any questions you may ask .Thankx
$50 USD in 1 day
4.7 (4 reviews)
3.1
3.1
User Avatar
A proposal has not yet been provided
$77 USD in 1 day
5.0 (2 reviews)
1.4
1.4
User Avatar
A proposal has not yet been provided
$55 USD in 1 day
0.0 (0 reviews)
0.0
0.0
User Avatar
I recently graduated from Middle East Technical University, NCC, with my 100% ÖSYM Schoolarship, B.Sc. degree in Computer Engineering (June, 2015). Moreover, I am a software engineer who loves trying different things. Currently, I'm developping some mobile apps to sharpen my skills and gain more experience on technology world. I will gladly consider offers in industry about Software Design&Development.
$66 USD in 1 day
0.0 (0 reviews)
0.0
0.0
User Avatar
Propunerea nu a fost încă furnizată
$30 USD in 3 days
0.0 (0 reviews)
0.0
0.0
User Avatar
Hi Dear I can do this c prrogram I have experience with large code base for big projects And I will assure you that I will delivered the work you requested with high quality and reliability and I will explain to you my approach to achieve the programming tasks Feel free to contact me
$10 USD in 5 days
0.0 (0 reviews)
0.0
0.0
User Avatar
A proposal has not yet been provided
$20 USD in 2 days
0.0 (0 reviews)
0.0
0.0
User Avatar
A proposal has not yet been provided
$20 USD in 1 day
0.0 (0 reviews)
0.0
0.0
User Avatar
Hello, I am a hardcore c++ developer from last more than 6 years. i am interested in your project. Please reply me asap. Thanks, Jitendra
$55 USD in 3 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED STATES
Lees Summit, United States
3.6
1
Payment method verified
Member since Aug 24, 2015

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.