C Workshop
NotQuiteEdges.h File Reference
#include <stdbool.h>

Go to the source code of this file.

Functions

int NotQuiteEdges (int *secondSmallest, int *secondLargest)
 Reads numbers from the user (terminated by 0) and returns the second smallest and second largest in the corresponding parameters. More...
 
int PrintNotQuiteEdges ()
 Reads numbers from the user (terminated by 0) and prints the second largest and second smallest numbers. More...
 
int ReadNumber ()
 Prompts and reads a number from the user. More...
 

Function Documentation

◆ NotQuiteEdges()

int NotQuiteEdges ( int *  secondSmallest,
int *  secondLargest 
)

Reads numbers from the user (terminated by 0) and returns the second smallest and second largest in the corresponding parameters.

Note
There must be at least two numbers to compute a valid output.
Parameters
secondSmallestAddress to store the second smallest number.
secondLargestAddress to store the second largest number.
Returns
0 on success, -1 if there are fewer than two numbers

◆ PrintNotQuiteEdges()

int PrintNotQuiteEdges ( )

Reads numbers from the user (terminated by 0) and prints the second largest and second smallest numbers.

Note
There must be at least two numbers to compute a valid output.
Returns
0 on success, -1 if there are fewer than two numbers

◆ ReadNumber()

int ReadNumber ( )

Prompts and reads a number from the user.

Returns
int The number read