Question

Requirement Write pseudocode and translate it to ONE C-program for each the following problems. In your pseudocode and C-prog

0 0
Add a comment Improve this question Transcribed image text
Answer #1

3)

CODE

#include <stdio.h>

int main(void) {

int arr[10];

int size = 0;

printf("Please input a sequence of numbers ended by 0: ");

int num;

scanf("%d", &num);

while(num != 0) {

arr[size ++] = num;

scanf("%d", &num);

}

int min = arr[0];

printf("\nThe numbers in the reverse order of your input are: ");

for (int i=size-1; i>=0; i--) {

printf("%d ", arr[i]);

}

for (int i=1; i<size; i++) {

if (min > arr[i]) {

min = arr[i];

}

}

printf("\nThe minimal number of them is: %d", min);

}

NOTE: As per HOMEWORKLIB POLICY, I am allowed to answer only 1 coding questions (including sub-parts) on a single post. Kindly post the remaining questions separately and I will try to answer them. Sorry for the inconvenience caused.

Add a comment
Know the answer?
Add Answer to:
Requirement Write pseudocode and translate it to ONE C-program for each the following problems. In your...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • this program is in C. Write a program that computes the number of elements in an...

    this program is in C. Write a program that computes the number of elements in an array divisible by a user specified number. Declare an integer array of size 7 and read the array elements from the user. Then, read a number k from the user and compute the number of elements in the array divisible by k. Consider the following example. 3 elements in this array are divisible by 2 ({2,2,4}). Sample execution of the program for this array...

  • Write the following program in C++ You run four computer labs, Each lab contains computer stations...

    Write the following program in C++ You run four computer labs, Each lab contains computer stations that are numbered as shown in the table below: Lab Number Computer Station Numbers 1 1 - 5 2 1 - 6 3 1 - 4 4 1 - 3 Each user has a unique five-digit ID number. Whenever a user logs on, the user’s ID, lab number, and the computer station number are transmitted to your system. For example, if user 49193 logs...

  • Develop a system flowchart and then write a menu-driven C++ program that uses user-defined functions arrays,...

    Develop a system flowchart and then write a menu-driven C++ program that uses user-defined functions arrays, and a random number generator. Upon program execution, the screen will be cleared and the menu shown below will appear at the top of the screen and centered. The menu items are explained below. Help Smallest Quit H or h ( for Help ) option will invoke a function named help() which will display a help screen. The help screen(s) should guide the user...

  • Write a C program Design a program that uses an array to store 10 randomly generated...

    Write a C program Design a program that uses an array to store 10 randomly generated integer numbers in the range from 1 to 50. The program should first generate random numbers and save these numbers into the array. It will then provide the following menu options to the user: Display 10 random numbers stored in the array Compute and display the largest number in the array Compute and display the average value of all numbers Exit The options 2...

  • Can you fix this program and run an output for me. I'm using C++ #include using...

    Can you fix this program and run an output for me. I'm using C++ #include using namespace std; //function to calculate number of unique digit in a number and retun it int countUniqueDigit(int input) {    int uniqueDigitCount = 0;    int storeDigit = 0;    int digit = 0;    while (input > 0) {        digit = 1 << (input % 10);        if (!(storeDigit & digit)) {            storeDigit |= digit;       ...

  • Write a menu driven program to demonstrate the use of array and switch. It must be...

    Write a menu driven program to demonstrate the use of array and switch. It must be written in C language . Here is the menu - Press 1 to add a number to the array. Press 2 to display the numbers entered in the array so far Press 3 to find the average of the numbers entered. Press 4 to exit. Option 1 - The user should be able to enter 20 numbers only. If all twenty numbers are entered...

  • Write a C++ program that simulates a lottery. The user will select 5 numbers 0 through...

    Write a C++ program that simulates a lottery. The user will select 5 numbers 0 through 9 and put this in an array. Then these user numbers are compared to the random numbers the computer generated. The program will display both the computer random number and below the user selected numbers. The program will tell the user how many matches are made. If the user guesses all five you let them know they are the grand winner. Here is the...

  • C Programming For this task, you will have to write a program that will prompt the...

    C Programming For this task, you will have to write a program that will prompt the user for a number N. Then, you will have to prompt the user for N numbers, and print then print the sum of the numbers. For this task, you have to create and use a function with the following signature: int sum(int* arr, int n); Your code should look something like this (you can start with this as a template: int sum(int* arr, int...

  • Here is the assignment: Fibonacci or Prime number iterator: Design a menu driven program that performs...

    Here is the assignment: Fibonacci or Prime number iterator: Design a menu driven program that performs the user’s choice of the following functions the program exits should also be a user’s choice. Menu Item 1: Fibonacci number iterator, here you are to define an iterator class named FibonacciIterator for iterating Fibonacci numbers. The constructor takes an argument that specifies the limit of the maximum Fibonacci number. For example, prompt the user for size, use the size to call FibonacciIterator(“user input”)...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT