Hi guys. Can you help me? I'm kinda bummed. Tf. Keeps on doing infinite loops. Thanks :)
//Write a program that will ask for 3 numbers from the user.Amongst the
//three(3) values, determine the smallest,middle,and biggest number.The
//smallest and the biggest numbers serve as the range and the middle
//number serves as the multiple. Display the multiples of the given
//range. The program should repeat until the user exits.
#include <iostream>
using namespace std;
int main () {
int num1;
int num2;
int num3;
int smallest;
int middle;
int biggest;
int multiple;
char ans='Y';
//Type the first three numbers.
cout << "Type 3 numbers: " ;
cin >> num1 >> num2 >> num3;
//Display the multiples of the given number.
cout << "Multiples of " << num1 << " from " << num2 << " to " << num3 << ": ";
while (smallest<biggest || smallest<=middle)
cout << smallest++ << " ";
Well, the way you tried finding the biggest, middle and smallest was completely wrong. You didn't achieve anything. This is something you could've done: