Find Jobs
Hire Freelancers

C++ and small task

$10-30 USD

Completed
Posted over 2 years ago

$10-30 USD

Paid on delivery
1- Compile and run the following program and answer the following: a. what do you think is the role of the inner loop in both if and the else blocks? b. Modify code in order to make the child process finish before the parent process starts #include <stdio.h> #include <sys/wait.h> /* contains prototype for wait */ #include <unistd.h> /* contains fork prototype */ #include <stdlib.h> #define ITR 100000 int main() { int i,j,pid; pid = fork(); if( pid == 0 ){ for ( i=0;i<20;i++){ for (j=0;j<ITR ;j++); printf("Child:%d\n",i); } } else{ for ( i=0;i<20;i++){ for (j=0;j<ITR;j++); printf("Parent:%d\n",i); } } } 2- Write a C program to create four processes parent and 3 children where they terminate in a sequence as follows: a. Parent process terminates at last b. First child terminates before parent and after second child. c. Second child terminates after last and before first child. d. Third child terminates first. The output should be similar to the following image where each process should print its ID and its parent ID
Project ID: 31813031

About the project

8 proposals
Remote project
Active 3 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
Hello, I can do this for u in 1 hour. Coding will be easily unferstandable. Lets have a chat so we can discuss further. Thanks.
$25 USD in 1 day
4.9 (101 reviews)
5.9
5.9
8 freelancers are bidding on average $26 USD for this job
User Avatar
Hi there yes I am Programming Expert and I can do this one ASAP Kindly send me a message we'll discuss further Looking forward to hear you Thank you.
$25 USD in 1 day
5.0 (169 reviews)
5.6
5.6
User Avatar
******* HIGH QUALITY and IMMEDIATE WORK ********* Hi, dear client! I'm so happy to bid on this interesting project. I have read your requirements carefully and feel confident to finish this task well in tight deadline. I hope to discuss more detail. Thank you
$25 USD in 7 days
4.9 (23 reviews)
5.4
5.4
User Avatar
/**********************************/ https://www.freelancer.com/u/torrikress2 I already bid to your project, but it is deleted.... If the task deleted automatically, directly hire me, please. https://www.freelancer.com/u/torrikress2 Thanks.
$25 USD in 7 days
5.0 (24 reviews)
5.1
5.1
User Avatar
Dear Client. I am Nikita Thank you for your posting. I've just read your description and guarantee 100% success on your job. Let's discuss about budget and deadline on private chat. Looking forward to hearing from you soon. Thanks
$25 USD in 1 day
4.8 (30 reviews)
5.0
5.0
User Avatar
Hi , I am C/C++ expert , I can do this job so perfectly , just let me do it . CONTACT ME PLEASE ! ( I'm who you was talking with !!!!!!!!!!!!!! , let me start the work !!!) 100% satisfaction guarantee 100% satisfaction priority
$25 USD in 1 day
5.0 (13 reviews)
4.3
4.3
User Avatar
Hello, ⭐️⭐️I’m Ready to start Immediately⭐️⭐️ I have read your requirements carefully and I am very interested in your project. If hired by you I will be responsible to complete the task within the stipulated time frame and with confidence. Will be waiting for your kind response. Best Regards! Adeeb Ibrhaim
$30 USD in 7 days
5.0 (6 reviews)
3.5
3.5

About the client

Flag of SAUDI ARABIA
Alriyadh, Saudi Arabia
5.0
8
Payment method verified
Member since Apr 28, 2017

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.