Final exam, question #3 (or quiz #9)

Hi programigos! This is the video tutorial/code for solving the third question on our final exam: smallest_of_four. Enjoy and good luck!

#include <iostream>
using namespace std;

float smallest_of_four(int a, int b, int c, int d)
if(a<=b, a<=c, a<=d)
return a;
else if(b<a, b<=c, b<=d)
return b;
else if(c<a, c<b, c<=d)
return c;
return d;

int main()
int a, b, c, d;
cout<<“Insert the four numbers that you want to evaluate: “<<endl;
cout<<“The smallest number is “<<smallest_of_four(a, b, c, d)<<“.”<<endl;
return 0;


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s