hey everybody ...as im a starter i tried to create some single scripts first... so i decided to make a program which gets what ever number the user wants and then it calculates the min.
it compiles without any error but its really weird that it calculates the max instead... + idk why there is something wrong with the loop.
could some body help me? :S
i edited it a lil bit... it works fine when i press y ... but the count system( please press the number "i") doesnt work :( also when i press n it doesnt count the min :S
#include <iostream>
usingnamespace std;
int main()
{
char c;
int a,b,min;
c='y';
cout<<"Please enter a number: ";
cin>>a;
min=a;
while(c=='y')
{
cout<<"\nPlease enter another number: ";
cin>>a;
if(c=='y')
{
if(a<min)
min=a;
}
cout<<"\nDo you wanna continue?(y,n)\n";
cin>>c;
}
cout<<"Here is the minimum: "<<min;
}
@ocasio101 : thx :)
@moschops : well this is what we use in class (as begginers in pawn) any modern compiler you suggest? which is kinda near turbo c++? :)
Quit using Turbo C++. It's a very old compiler and if you are studying from a modern book your programs won't compile to be correct even if they are. Use Visual C++ Express (it's free) from Microsoft or use G++ via MinGW or Cygwin.