Need a basic program in C using the following instructions: prompt the user for
ID: 3591817 • Letter: N
Question
Need a basic program in C using the following instructions:
prompt the user for the number of players (maximum of 5)
prompt the user for the number of cards to generate for each player (maximum of 10)
for each card for each player, generate a valid bingo card (5 columns and 5 rows, with each card having the word BINGO on top)
provide a menu for the user to select which user/bingo card to display, to run a histogram on the bingo cards generated to see how many times each number between 1 and 75 appeared, and last option on menu is to exit program
Explanation / Answer
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
main(void)
{
int bingo[5][5];
int row;
int col;
int num=15;
randomize();
clrscr();
for(row=0;row<5;row++)
{
for(col=0;col<5;col++)
{
bingo[row][col]=rand()%num+1;
}
printf(" ");
}
for(row=0;row<5;row++)
{
for(col=0;col<5;col++)
{
printf("%d ", bingo[row][col]);
}
printf(" ");
}
getch();
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.