Develop a program that accepts integers from command line, sorts the integers into ascending order, computes the sum of the integers, and counts the number of even numbers and the number of odd numbers.
Solve in C programing language?
Here the code to get the integer value from command line and display it in the ascending order. And also it will display the counts of even and odd numbers.
#include<stdio.h>
int main()
{
int n, data[100],i,j,temp;
int Even_Count = 0; Odd_Count = 0;
/*get the number of entries
printf("enter the input for n :");
scanf("%d", &n);
/* get the input data
for(i=0; i<n; i++)
scanf("%d", &data[i]);
/* ascending order
for(i=0;i<n-1;i++)
{
for(j=i+1;j<n;j++)
{
if(data[i] > data[j]) {
temp = data[i];
data[i]= data[j];
data[j]=temp;
}
}
}
/* data in ascending order
printf("Ascending order: \n");
for(i=0; i<n; i++)
printf("%d\n", data[i]);
for(i=0;i<n;i++)
{
if(data[i] % 2 == 0)
{
Even_Count++;
}
else
{
Odd_Count++;
}
}
printf("\n Number of even number is = %d " , Even_Count );
printf("\n Number of odd number is = %d " , Odd_Count);
return 0;
}
Develop a program that accepts integers from command line, sorts the integers into ascending order, computes...
solve c programing language with Output screeshort? Develop a program that accepts integers from command line and uses fork() to have 4 child processes that will do sorting the integers into ascending order, computing the sum of the integers, and counting the number of even numbers and the number of odd numbers respectively.
Develop c program and give me screenshot of output? Develop a program that accepts integers from command line and uses fork() to have 4 child processes that will do sorting the integers into ascending order, computing the sum of the integers, and counting the number .of even numbers and the number of odd numbers respectively.
Develop c program and give me screenshot of output? Develop a program that accepts integers from command line and uses fork() to have 4 child processes that will do sorting the integers into ascending order, computing the sum of the integers, and counting the number .of even numbers and the number of odd numbers respectively
2. Write a Marie program that accepts two positive (inputs) two integers and outputs the sum of both of the integers and all the numbers in between Write a Marie program that determines the largest of a series of positive integers provided by a user. The user will enter a -1 when she is finished. Up to 10 numbers will be provided by the user. Write a Marie program that accepts two positive integers, multiples them by repeated addition, and...
write a program in x86 assembly language that sorts 10 integers entered from the keyboard and displays them in order
Write a program that will accept two integers on command line, use the swap subprogram to swap them, and then print the two numbers out. For example, I enter a.out 10 15 and the output that would print is 15 10. Please note that if exactly two numbers are not provided on command line, your program should display an error message and end with no further action. The programming language is C Compiler.
Command Line Arguments: Write a program in C Compiler that will accept two integers on command line, subtract the second from the first (1st - 2nd) and display the answer. It exactly two numbers are not provided on command line, there should be a simple error message printed and the program ends with no further input, output, or calculations
Write a bash script that accepts one command line argument 'a' which is an integer between 1 and 50 inclusive. It should output a list of integers from 'a' and ending with '1' according to the following iteration rule. ( fx = x/2 if x is even; fx=3x+1 if x is odd )
Write a bash script question.sh that accepts one command line argument which is supposed to be a positive integer n. The script should print all odd integers from 1 through n. Write a C or C++ program question.c(pp) to read from stdin as many integers as there are available and then print the squares of all these integers. You should test your code by “./question.sh <n> | ./question” assuming the compiled C/C++ program is question. See the following for a...
C++ Write a program that reads three positive integers (> 0) from the command line (one at a time), then computes and prints the smallest entered number. Use if-else statements for three integer comparison. Example: Enter an integer: 5 Enter an integer: 23 Enter an integer: 7 The smallest number is: 5 Example 2: Enter an integer: 3 Enter an integer: 3 Enter an integer: 6 The smallest number is: 3 "The input must be positive number. The program should...