Find Jobs
Hire Freelancers

C programs

$10-20 USD

Terminado
Publicado hace más de 8 años

$10-20 USD

Pagado a la entrega
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
ID del proyecto: 8601479

Información sobre el proyecto

16 propuestas
Proyecto remoto
Activo hace 9 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
Adjudicado a:
Avatar del usuario
Dear, I have done work on this and can give you task as early as you need. Regards, Jawwad
$30 USD en 1 día
3,2 (1 comentario)
0,6
0,6
16 freelancers están ofertando un promedio de $55 USD por este trabajo
Avatar del usuario
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 en 1 día
4,9 (422 comentarios)
8,4
8,4
Avatar del usuario
A proposal has not yet been provided
$39 USD en 1 día
5,0 (32 comentarios)
5,2
5,2
Avatar del usuario
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 en 3 días
4,8 (65 comentarios)
5,1
5,1
Avatar del usuario
La propuesta todavía no ha sido proveída
$66 USD en 1 día
5,0 (9 comentarios)
4,6
4,6
Avatar del usuario
A proposal has not yet been provided
$45 USD en 3 días
4,7 (18 comentarios)
4,9
4,9
Avatar del usuario
Hello. More 20 years programming experience. I need more details to set real time and price. Regards. ---------------------------------------------------------------------------------------------------------------------------------------------------
$100 USD en 3 días
4,8 (12 comentarios)
4,4
4,4
Avatar del usuario
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 en 1 día
4,7 (4 comentarios)
3,1
3,1
Avatar del usuario
A proposal has not yet been provided
$77 USD en 1 día
5,0 (2 comentarios)
1,4
1,4
Avatar del usuario
A proposal has not yet been provided
$55 USD en 1 día
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
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 en 1 día
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
Propunerea nu a fost încă furnizată
$30 USD en 3 días
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
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 en 5 días
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
A proposal has not yet been provided
$20 USD en 2 días
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
A proposal has not yet been provided
$20 USD en 1 día
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
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 en 3 días
0,0 (0 comentarios)
0,0
0,0

Sobre este cliente

Bandera de UNITED STATES
Lees Summit, United States
3,6
1
Forma de pago verificada
Miembro desde ago 24, 2015

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.