perchè spara numeri a caso in output?
che cosa non va?codice:#include <stdio.h> #define SIZE 2 int main() { int m[SIZE][SIZE]; int i,j, k; printf("enter any integer between 1 and 21"); for (i=0;i<SIZE;i++) { for (j=0;j<SIZE;j++) { printf("/>"); scanf("%d",&k); while(k<1||k>21) { printf ("your value is not correct\n\n enter any integer between 1 and 21 "); printf ("/>");scanf("%d",&k); m[i][j]=k; } } } for (i=0;i<=SIZE;i++) { for (j=0;j<=SIZE;j++) { printf("%d", m[i][j]); } } system ("PAUSE"); return 0; }
Grazie

Rispondi quotando