visual studio 2012 - C++ lotto number generator -
i'm working on program must make array of 5 random numbers between 0-9, must ask user enter 5 numbers between 0-9 , store in , array, compare them , show if have gotten them right. wrote out keeps giving me error
error 1 error c1075: end of file found before left brace '{' @ 'c:\users\bigt\documents\visual studio 2012\projects\consoleapplication2\ consoleapplication2\source.cpp(9)' matched c:\users\bigt\documents\visual studio 2012\projects\ consoleapplication2\consoleapplication2\source.cpp 65 1 consoleapplication2
which makes me think have logical error, can me find i'm doing wrong here?
//#include "stdafx.h" #include <iostream> #include <cstdlib> using namespace std; //void showvalues(int[], int); int main() { const int array_size = 5; int numbers[array_size]; int win_num[array_size]; int count = 0; cout << "enter altto drawing" <<endl; for(int = 0; < array_size; i++) { cin >> numbers[i]; } (int = 0 ; < array_size; i++) { win_num[i] = rand()%10; } (int =0; < array_size; i++) { if (numbers[i] != win_num[i]) { cout << "sorry try again" << endl; } else { count++; } if (count == 5) { cout << " win" << endl; } else { cout << " did not win, had" << count << "right numbers" << endl; } cout << "the winning numbers are" << endl; for( int = 0; < array_size ; ++) { cout << win_num[i] << " "; } system ("pause"); return 0; }
you missed 1 closing }
here:
for (int =0; < array_size; i++) { if (numbers[i] != win_num[i]) { cout << "sorry try again" << endl; } else { count++; } }//^^this 1 missing
Comments
Post a Comment