Test6 - cin>> numbers numbArray[index]=numbers index while(test!=index for(int i=0 i<index i if(numbArray[test]==(2*numbArray[i count test

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
#include <iostream> #include <string> # using namespace std; u int yes=1; int numbers=2; int count; int doubled; int test=0; int index=-1; int numbArray[15]; i int main(){ while (numbers!=-1){ cin>> numbers; if (numbers != 0) {numbArray[index]=numbers;index++;} while (numbers !=0){
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: cin >> numbers; numbArray[index]=numbers; index++; } while (test!=index){ for (int i=0; i<index; i++){ if (numbArray[test]==(2*numbArray[i])) count++; test++; } } cout << count << endl; count=0; index=0; test=0; cin>> numbers; } }...
View Full Document

This note was uploaded on 05/03/2011 for the course CSCI 180 taught by Professor Goldwasser,m during the Fall '08 term at Saint Louis.

Ask a homework question - tutors are online