Informática, perguntado por Celinojoao, 1 ano atrás

Como gerar 3 valores aleatórios (rand) em uma matriz 10X10 na linguagem c?

Soluções para a tarefa

Respondido por WildBacon
1
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(){
    int matriz[10][10],c,x;
    srand(time(NULL));
    for(x=0;x<10;x++){
        for(c=0;c<10;c++){
            matriz[x][c]=rand();
        }
    }
    for(x=0;x<10;x++){
        for(c=0;c<10;c++){
            printf("[%d] ",matriz[x][c]);
            
        }
        printf("\n");
    }
    system("PAUSE");
}
Perguntas interessantes
Matemática, 7 meses atrás