Question #29391

programme that terminate at negative value by given input values using while loop

Expert's answer

#include <iostream.h>

void main() {
int i=1,input;
cout << "Enter a number
"
cin >> input;
while(input >= 0)
{
i++;
cout << "Enter anothernumber
";
cin >> input;
}
cout << "
You have entered "<< i << " numbers";
}
LATEST TUTORIALS
APPROVED BY CLIENTS