Guest_imported
New member
- Jan 1, 1970
- 0
should display the following ;
x x xxx
xx x x x
x x x x x
x xx x x
x x xxx
from this file
100010000111Y
1100100010001Z
10101001000001Y
1001100010001Z
100010000111Z
E
/* CH8A.C */
/* Interprets lines of A's and B's */
#include <stdio.h>
main ()
{
/* Description ......
Open input file
Read first character
WHILE not at end of file
WHILE not at end of line
IF character = A
Display X
ELSE
Display a space
Read next character
Read past newline and read 1st character on next line
Move to next line in output
Close input file
*/
/* variable declarations */
char current_character;
FILE *ch8a01 = fopen ("ch8a01.dat", "r"
fscanf (ch8a01, "%d", ¤t_character);
while (current_character != "E"
while ((current_character != "Y" || (current_character != "Z");
{
if (current_character = "A"
printf ("X"
else (current_character = " "
printf (" "
}
fscanf (ch8a01, "%d", ¤t_character);
fclose (ch8a01);
getch ();
}
Can you plaese help me get the right coding
x x xxx
xx x x x
x x x x x
x xx x x
x x xxx
from this file
100010000111Y
1100100010001Z
10101001000001Y
1001100010001Z
100010000111Z
E
/* CH8A.C */
/* Interprets lines of A's and B's */
#include <stdio.h>
main ()
{
/* Description ......
Open input file
Read first character
WHILE not at end of file
WHILE not at end of line
IF character = A
Display X
ELSE
Display a space
Read next character
Read past newline and read 1st character on next line
Move to next line in output
Close input file
*/
/* variable declarations */
char current_character;
FILE *ch8a01 = fopen ("ch8a01.dat", "r"
fscanf (ch8a01, "%d", ¤t_character);
while (current_character != "E"
while ((current_character != "Y" || (current_character != "Z");
{
if (current_character = "A"
printf ("X"
else (current_character = " "
printf (" "
}
fscanf (ch8a01, "%d", ¤t_character);
fclose (ch8a01);
getch ();
}
Can you plaese help me get the right coding