void FillArray(int m[35]) { int i; for (i = 0; i <= 34; i++) { printf("Enter Mark for Element[%d] :", i); scanf("%d", &m[i]); while (m[i]<=1 || m[i]>=7) { printf("\nError! Mark should in range of (2 to 6).\n\n"); printf("Enter Mark again for Element[%d] :", i); scanf("%d", &m[i]); } } }
while
if
scanf
Quote:scanf("%d", &m[i]);
if ( scanf("%d", &m[i]) != 1 ) { // handle error. }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)