|
-
September 6th, 2012, 11:53 AM
#1
Where did i go wrong??
i wrote this program using Dev++ but it only freezes when it runs, where did i go wrong??
Here's the code:
#include<iostream>
using namespace std;
int main(){
int numbers;
int counter1=0;
int counter2=0;
cout<<"enter numbers, 0 to stop the program and display the result"<<endl;
cin>>numbers;
while(numbers!=0){
if(numbers<0){
counter1 = counter1+1;
}
else
counter2=counter2+1;
if(number==0){
cout<<"you have entered "<<counter1<<" Negative numbers!""<<endl;
}
return 0;
system("pause");
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|