SHARE
TWEET

CRUZ

a guest Feb 17th, 2020 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3. int main ()
  4. {
  5.     float n1, n2, n3, n4, n5, n6, n7, n8, n9, n10;
  6.     cout <<"Enter ten numbers";
  7.     cin >> n1 >> n2 >> n3 >> n4 >> n5 >> n6 >> n7 >> n8 >> n9 >> n10;
  8.     if (n1 <= n2 && n1 <= n3 && n1 <= n4 && n1 <= n5 && n1 <= n6 && n1 <= n7 && n1 <= n8 && n1 <= n9 && n1 <= n10)
  9.     {
  10.         cout << "Smallest number" << n1;
  11.     }
  12.     if (n2 <= n1 && n2 <= n3 && n2 <= n4 && n2 <= n5 && n2 <= n6 && n2 <= n7 && n2 <= n8 && n2 <= n9 && n2 <= n10)
  13.     {
  14.         cout << "Smallest number: " << n2;
  15.     }
  16.     if (n3 <= n1 && n3 <= n2 && n3 <= n4 && n3 <= n5 && n3 <= n6 && n3 <= n7 && n3 <= n8 && n3 <= n9 && n3 <= n10)
  17.     {
  18.         cout << "Smallest number: " << n3;
  19.     }
  20.     if (n4 <= n1 && n4 <= n2 && n4 <= n3 && n4 <= n5 && n4 <= n6 && n4 <= n7 && n4 <= n8 && n4 <= n9 && n4 <= n10)
  21.     {
  22.         cout << "Smallest number: " << n4;
  23.     }
  24.     if (n5 <= n1 && n5 <= n2 && n5 <= n3 && n5 <= n4 && n5 <= n6 && n5 <= n7 && n5 <= n8 && n5 <= n9 && n5 <= n10)
  25.     {
  26.         cout << "Smallest number: " << n5;
  27.     }
  28.     if (n6 <= n1 && n6 <= n2 && n6 <= n3 && n6 <= n4 && n6 <= n5 && n6 <= n7 && n6 <= n8 && n6 <= n9 && n6 <= n10)
  29.     {
  30.         cout << "Smallest number: " << n6;
  31.     }
  32.     if (n7 <= n1 && n7 <= n2 && n7 <= n3 && n7 <= n4 && n7 <= n5 && n7 <= n6 && n7 <= n8 && n7 <= n9 && n7 <= n10)
  33.     {
  34.         cout << "Smallest number: " << n7;
  35.     }
  36.     if (n8 <= n1 && n8 <= n2 && n8 <= n3 && n8 <= n4 && n8 <= n5 && n8 <= n6 && n8 <= n7 && n8 <= n9 && n8 <= n10)
  37.     {
  38.         cout << "Smallest number: " << n8;
  39.     }
  40.     if (n9 <= n1 && n9 <= n2 && n9 <= n3 && n9 <= n4 && n9 <= n5 && n9 <= n6 && n9 <= n7 && n9 <= n8 && n9 <= n10)
  41.     {
  42.         cout << "Smallest number: " << n9;
  43.     }
  44.     if (n10 <= n1 && n10 <= n2 && n10 <= n3 && n10 <= n4 && n10 <= n5 && n10 <= n6 && n10 <= n7 && n10 <= n8 && n10 <= n9)
  45.     {
  46.         cout << "Smallest number: " << n10;
  47.     }    
  48.  
  49. return 0;
  50. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top