I'm starting to feel bad for coming to the board so often![]()
I'm trying to make a program that asks the user for 6 numbers, how many times they would like to put in 6 numbers, and then print out all the sets of numbers. I'm pretty sure a 2-dimensional array is the way to go, but I'm not having any luck with getting this to work. It compiles, but won't do anything after entering in my numbers. Suggestions are welcomed and appreciated.
Code:#include <stdio.h> #include <stdlib.h> #include<string.h> #include<ctype.h> #include<time.h> int main(void) { int lotto[6][5]; int r, c; int games = c; printf("How many games would you like to play?(5 games max) "); scanf("%d", &games); printf("enter in your 6 numbers \n"); for(r=0; r<6; r++) { scanf("%d", &lotto[r]); for(c=0; c<5; c++) { scanf("%d", &lotto[c]); } } //end for r for(r=0; r<6; r++) { printf("%d ", lotto[r]); for(c=0; c<5; c++) { printf("%d ", lotto[c]); } } //end for c printf("\n"); system("PAUSE"); return 0; }



LinkBack URL
About LinkBacks



