0
My code isn't working can somebody help me
#include <iostream> using namespace std; int main() { int num,ln=1,small; while(ln<=5) { cout<<"\nEnter a Number: "; cin>>num; ++ln; if(num<=small) {small=num;} else {small=small;} } cout<<"\nThe Smallest Number is: "<<small; return 0; }
5 Réponses
+ 4
I said any number bigger then your inputs. Like small=100;
+ 2
Your code working just put initial value to small variable. (Any big number) . You're comparing unknown value to a variable. So that it's not working. Just give value to small variable
0
I tried to put 0 in small variable then the smallest is 0
0
You didn't give a value to the variable "small"