output order
i want to how to make the output dependent on its each individual inpu #include <iostream> #include <cstdlib> #include <cmath> #include <ctime> using namespace std; int main() { srand(time(0)); int r = rand(); char a,e,i,o,u; int c = r % 40 + 1; int v = r % 40 + 41; int b = r % 40 + 81; int n = r % 40 + 121; int m = r % 40 + 161; cout <<"This program plays a simple random number game.\n"; cout <<"Enter 5 vowel characters(a,e,i,o,u) separated by space: "; if (cin>>a) a = c ; if (cin>>e) e = v ; if (cin>>i) i = b; if (cin>>o) o = n; if (cin>>u) u = m; cout <<"The random numbers are "<< c <<" "<<v <<" "<< b<<" " << n<<" " << m; return 0; } Edit & Run if you run this those codes , you can see that when enter 5 different vowels a, e ,i , o ,u in different position like e ,i ,a u, o the output of the program still stick to the format "a, e,i o ,u" not "e ,i , a ,u ,o" so is there anyway so that outputs of this are in same position as e,i,a,u,o not a,e,i,o,u.