Name: Anonymous 2013-11-19 1:40
// ConsoleApplication6.cpp : Defines the entry point for the console application.
#include "stdafx.h"
#include <stdlib.h>
#include <stdio.h>
int valid(int);
int main(void){
int i, num;
int input[1][4];
//int guess[1][4];
char test;
printf("To begin, you need to enter four numbers between 1 and 4 below.\n");
// User Input and checking
do{
for (i=0; i<4; i++){
printf("Please input an integer between 1 and 4: ");
//scanf_s("%d", input[1][i]);
input[1][i] = getchar();
}
}
while(test != valid(num));
printf("\n%d", input[1][4]);
return 0;
}
int valid(int input[1][i]){
if (input[1][i]<1 && input[1][i]>4)
return 1;
else
return 0;
}
#include "stdafx.h"
#include <stdlib.h>
#include <stdio.h>
int valid(int);
int main(void){
int i, num;
int input[1][4];
//int guess[1][4];
char test;
printf("To begin, you need to enter four numbers between 1 and 4 below.\n");
// User Input and checking
do{
for (i=0; i<4; i++){
printf("Please input an integer between 1 and 4: ");
//scanf_s("%d", input[1][i]);
input[1][i] = getchar();
}
}
while(test != valid(num));
printf("\n%d", input[1][4]);
return 0;
}
int valid(int input[1][i]){
if (input[1][i]<1 && input[1][i]>4)
return 1;
else
return 0;
}