Prof ... this is the program where the error? I put both the image and the whole program written at least if you want to try to fill it ....
# include int i;
nations char [15] [30];
capital char [15] [30];
FILE * f1;
FILE * f2;
void letturaFileNazioni () {
f1 = fopen ("listaNazioni.txt", "r");
for (i = 0; the <15; i++){
fscanf (f1, "% s", countries [i]);}
fclose (f1 );}
letturaFileCapitali void () {
f1 = fopen ("listaCapitali.txt", "r");
for (i = 0; the <15; i++){
fscanf (f1, "% s", capital [i]);}
fclose (f1);}
void test () {
for (i = 0; the <15; i++){
printf ("% s \\ n", countries [i]);}
printf ("\\ n");
for (i = 0; the <15; i++){
printf ("% s \\ n", capital [i]);
}} void
inizioGioco () {char a
[15];
int f;
int s;
s = 0;
f = 0;
for (i = 0; the <15; i++){
printf ("What is the capital of% s ", countries [i]);
scanf ("% s ", & nations [i]);
scanf ("% s", & a [i]);
if (a [i] == capital [i]) {printf
(you guessed ");
f = f +1;}
else
{printf ("you wrong");
s = s +1;
}}}
int main () {
letturaFileNazioni ();
letturaFileCapitali ();
test ();
inizioGioco ();
0 comments:
Post a Comment