define a function findsmallestnum() with no parameters that reads integers from input until a positive integer is read. the function returns the lowest of the integers read. ex: if the input is -80 -10 -70 95, then the output is: -80

Respuesta :

An executable code block is known as a function. It may be called repeatedly and reused. A function can deliver information back to you after receiving information from you. There are functions that come built-in to many programming languages that you can access in their libraries, but you can also write your own functions.

Code

#include <iostream>

using namespace std;  

int FindSmallestVal()

{    

int number = 0, min = 0;    

// reads number until the number > 0    

while (number <= 0)    

{        

cin >> number;        

// finds the minimum value in the min,number      

min = number < min ? number : min;    

}    

// returns minimum    

return min;

}

int main()

{    

int minimumVal;    

minimumVal = FindSmallestVal();      

cout << minimumVal << endl;

}

Input

-80 -10 -70 95

Output

-80

To know more about Programming languages, check out:

https://brainly.com/question/16936315

#SPJ4