C++ Programming Solutions

Input Numbers Until -ive # Entered & Count| if Condition | C++

Write a program that inputs numbers from the user till the user inputs a negative number. The program should then print the total number of times the number 1 was


using namespace std;
int main()
      int i = 1;
      int j=0;
     cout<<“Please enter a number, and When finished, enter a negative number = “<<endl;
      while(i >= 0)
                                cout<<“Enter a number = “;
                cout<<“\n1 Was Inputed “<<j<<” Times”;
                return 0;


prog C++ solution

About the author

Syed Moin Ali

Hello My Name is Syed Moin Ali and I am the founder of PC Learnings Here on this blog I write about Blogging, SEO, Internet Tricks, Social Networking Site, and Make Money