Fermé

Os project specific to C program

Can anyone rewrite below program without using 'do while' loop?

#include <stdio.h>

int main()

{

int number = 0;

int pid,status;

printf("Please enter a number n");

scanf("%d", &number);

if(number < 0)

{

printf("Please enter a positive number, greather than 0 n");

scanf("%d", &number);

}

pid = fork();

if(pid < 0)

{

printf(" Unsuccessful to create Child Process n");

exit(-1);

}

else if(pid == 0)

{

do

{

if(number%2 != 0)

{

number = (number*3)+1;

}

else if(number%2 == 0)

{

number = number/2;

}

printf("%d n",number);

}while(number != 1);

}

else

{

printf("pid %d n",pid);

printf("Waiting on child process to finish n");

wait(&status);

}

return 0;

}

Compétences : Programmation C

Voir plus : while loop c programming, scanf c programming, printf c programming, pid programming, os programming, if else c programming, else if c programming, do while c programming, c programming while loop, c programming scanf, c programming printf, c programming if else, guidance specific project , describe fulfill specific project requirementsattach link relevant work samplesbriefly describe company , create system calls parent process create print message exit sample program, need css tutor specific project, java program player class project card game, program grab specific data website, program 2005 lowest project, chat program source code project, gaf closed project buyer can give rating

Concernant l'employeur :
( 4 commentaires ) United States

N° du projet : #8497782

25 freelances ont fait une offre moyenne de 5 $ /heure pour ce travail

hbxfnzwpf

I am very proficient in c, c++. I have 15 years c++ developing experience now, and I have worked for 5 years. My work is online game developing, and mainly focus on server side, the language is c++ under linux. I used Plus

10 $ USD / heure
(49 Commentaires)
6.1
szymszteinsl

Nie złożono jeszcze oferty.

5 $ USD / heure
(37 Commentaires)
5.5
kteja85

A proposal has not yet been provided

5 $ USD / heure
(17 Commentaires)
4.5
nauman187

hi i can help. and start now please reply. thanks Plus

4 $ USD / heure
(25 Commentaires)
4.3
pinetree800

Hi,sir. I was interested when I saw your project. I can complete your project nicely. My skills are C, C++, Reversing, Matlab & Mathematics, Web scraping,Algorithm. I can help you very kindly. I can help you good Plus

5 $ USD / heure
(3 Commentaires)
2.5
wenguo214

thank you for your posting. your task is very happy for me. i have much experiences in C/C++ field. if you hire me, i will complete project ASAP. best regards.

5 $ USD / heure
(3 Commentaires)
2.4
belive12358

you can do it by use fork process to each loop so dont need use while. >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<

5 $ USD / heure
(4 Commentaires)
2.8
linzy1229

A proposal has not yet been provided

27 $ USD / heure
(2 Commentaires)
0.6
sinotix

It's extreamly simple task. I will do it in 5 minutes for free )) Please accept my bid just for my rating increasing

2 $ USD / heure
(0 Commentaires)
0.0
freelancer13690

I have a very good experience in C programing , unix programming, data structures. Hard working, will deliver within estimated timeline. Skill sets dev: android, C, C++, Java, Testing, Unix, Linux, python, html, css, Plus

5 $ USD / heure
(0 Commentaires)
0.0
gova23

Good working experience in C/C++ Languages. Discipline in completing the project Able to complete the work on time.

5 $ USD / heure
(0 Commentaires)
0.0
painman2

//do //{ //if(number%2 != 0) //{ //number = (number*3)+1; //} //else if(number%2 == 0) //{ //number = number/2; //} //printf("%d n",number); //}while(number != 1); for(;;) { if(number%2 != 0) Plus

11 $ USD / heure
(0 Commentaires)
0.0
lprett

Hello sir, it is a easy work for me, perhaps I do it free for you (You would only pay the site). Grateful!

2 $ USD / heure
(0 Commentaires)
0.0
parthyshah

​​​Hi employer, I have 3 years of professional work experience in C programming, Linux OS, Driver development. I have worked on various development boards like Xilinx-ZC702, Texas MSP430 Launchpad etc. I have mor Plus

4 $ USD / heure
(0 Commentaires)
2.1
writetraincreate

We can provide a program nowait, which is written in Pelles C. A do while loop has been replaced with a goto statement and skeleton code for wait and pid has been written and the program is executable (These functio Plus

5 $ USD / heure
(0 Commentaires)
0.0
vattikondasanjay

I having good knowledge in C-Programming and seeing the program which u need the help, i feel i'm best suitable for the project. :)

4 $ USD / heure
(0 Commentaires)
0.0
dnomesh

i am expert in c language. i also guiding my juniors. this experience very helpful for me to do the job.

5 $ USD / heure
(0 Commentaires)
0.0
dmpatil007

I have 5+ years of Experience in Software Development. Areas of Specialization: - C, C++ on UNIX / LINUX and Windows platform - Object-Oriented programming, Design Patterns, Agile methods - Experience in C++11, ST Plus

5 $ USD / heure
(0 Commentaires)
0.0
jj033684

I can do it easily

5 $ USD / heure
(0 Commentaires)
0.0
ducvo

using goto

5 $ USD / heure
(0 Commentaires)
0.0