Name: ________________________ Netid:
_______________ Section: _______
Name: ________________________ Netid: _______________ Section: _______
Name: ________________________ Netid:
_______________ Section: _______
#include <stdio.h>
#include <time.h> /* library containing the "time" function */
#include <stdlib.h> /* library containing the "rand" function */
void main(void)
{
int N;
int Total = 10;
int counter = 1;
printf("Enter a number: ");
scanf("%i", &N);
________do________________________________________________________________________
_________{_______________________________________________________________________
_____________printf(" %i ", rand()%(N+1));________________________________________
_____________counter = counter + 1;_______________________________________________________} while(counter <= Total);________________________________________________
printf("\n");
}
#include <stdio.h>
#include <time.h> /* library containing the "time" function */
#include <stdlib.h> /* library containing the "rand" function */
void main(void)
{
int N;
int Total = 10;
int counter = 1;
printf("Enter a number: ");
scanf("%i", &N);
__________for(counter = 1; counter <= Total; counter = counter +1)_____________
__________{______________________________________________________________________
_________________printf(" %i ", rand()%(N+1));___________________________________
___________}___________________or ____counter = counter +1; and no update statement above__________________________________________}________________________________________
printf("\n");
}