#include "stdafx.h" #include <iostream> #include <stdio.h> using namespace std; int main() { int arr[10]; int num=0; int i=0; while ( true ) { cout<<"please enter element "<<i<<" ::: "; cin>>num; if ( num < 0 ) break; arr[i]=num; for(int j=0; j<=i; j++) cout<< arr[j]; i++; cout<<endl; } getchar();getchar(); }
getchar
cin >> num;
cin
true
false
while
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)