Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

develop the program in c and give me screenshort of output program Based on your program.c , develop two separate programs, one for sorting integers

develop the program in c and give me screenshort of output program

Based on your program.c, develop two separate programs, one for sorting integers into ascending order, and the other for computing the sum of integers. Both programs accept integers from command line.

Then develop another program that would use an exec call to run the sorting program and summing program respectively in two different child processes. Let the parent process waits till each child process finish. Then the parent process uses the child process ending status value to know whether each child process ends successfully or not. If not successful, fork() a new child process to do the work again.

Program.c

#include #include #include int main(int argc, char * argv[]) { int n,i=0,j,temp, data[argc-1], Sum=0, EvenCount=0, OddCount=0; for (i=1; i

for(i=0;idata[j]) { temp=data[i]; data[i]=data[j]; data[j]=temp; } } }

printf(" Counts the Number of even number is : %d ",EvenCount); //printing data

printf(" Counts the Number of odd number is : %d ",OddCount);

printf(" sum of the integers number is : %d ",Sum);

printf(" Sorts the integers into Ascending order : "); for(i=0;i

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Google Analytics 4 The Data Driven Marketing Revolution

Authors: Galen Poll

2024th Edition

B0CRK92F5F, 979-8873956234

More Books

Students also viewed these Databases questions