I have a homework assignment that is asking me to get 25 random integers (rand()) for a make believe weather station I built. I don't know if what I've done so far is even right nor do I know where to go from here.
I don't just want answers I want to understand how to put the code together. I've searched all over google and in my textbook but it's not making sense to me. I'm not even sure if I can post this type of question here but I figured I would at least try.
#include <stdio.h>
#include <stdlib.h>
int main ()
{
int get_value()
{
int ran_num=rand()%40+60;
return ran_num;
}
int temp_value[25];
int ran_num=0;
for (ran_num=0; ran_num<sizeof(temp_value); ran_num++)
{
temp_value[0] = ran_num;
}
return 0;
}
Aucun commentaire:
Enregistrer un commentaire