Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream.h>
- #include <conio.h>
- void main()
- {
- clrscr();
- int n,inp_p(0),inp_n(0),inp_0(0);
- char inp;
- do
- {
- cout << "\nEnter any number: ";
- cin >> n;
- if(n<0)
- inp_n++;
- else if(n>0)
- inp_p++;
- else
- inp_0++;
- cout << "\nEnter 'y' to enter again or 'n' to continue: ";
- cin >> inp;
- } while(inp=='y'||inp=='Y');
- cout << "\n Of the entered nos.,\n\tNo. of positives are " << inp_p << "\n\tNo. of negatives are " << inp_n << "\n\tNo. of zeroes are " << inp_0 << endl;
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement