Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- using namespace std;
- void min(int a, int b, int c, int d) {
- if (a<b && a<c && a<d) {
- cout << a;
- }else{
- if (b<a && b<c && b<d) {
- cout <<b;
- }
- else {
- if (c<b && c<a && c<d) {
- cout <<c;
- }
- else {
- if (d<b && d<c && d<a) {
- cout <<d;
- }
- }
- }
- }
- }
- int main()
- {
- int a;
- cin >> a;
- int b;
- cin >> b;
- int c;
- cin >> c;
- int d;
- cin >> d;
- cout << "the smallest number is ";
- min(a, b, c, d);
- cout << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement