Kanjut SHELL
Server IP : 172.16.15.8  /  Your IP : 3.17.75.138
Web Server : Apache
System : Linux zeus.vwu.edu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Wed Nov 6 14:29:02 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 7.2.24
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0705) :  /home/lmking1/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //home/lmking1/input1.cpp
// File name: input1.cpp 
// Author: L'Tia King
// Date: 26 January 2009
// Compile: g++ input.cpp -o input1.out
// Run: ./input1.out
//
// Goal: The program reads a pos. number and outputs it, and quits when 
//       reading a 0 or a neg.

#include <iostream>

using namespace std;

int main()
{
	// 1. decl
	float x;


	// 2. read
	cout << "Input a pos., or quit for 0 and neg.: ";
	cin >> x;


	// 3. process and out
	while(x > 0)
	{
		cout << "The number is: " << x;
		cout << "\n\nInput a pos., or quit for 0/neg.: ";
		cin >> x;	
	}

	cout << "\n\nDone. Bye-Bye.\n\n";
	return 0;
}

Stv3n404 - 2023