Home > Back-end >  [C language help] tied for performing this code and other code output hollow box
[C language help] tied for performing this code and other code output hollow box

Time:03-06

(the purpose of this code is behind the input characters into the fourth letters, China - & gt; Glmre)

Problem description:
Output: when the independently execute this code Glmre
When along with other code execution output: mouth Glmr


# include & lt; Math. H>
# include & lt; Stdio. H>
Int main (void)
{
Printf (" hw 3.6 \ n ");
Printf (" please enter the 5 digit code: \ n ");
Char c [5];
int i;
for(i=0; i<6; I++)//a for loop enter multiple characters
{
[I] c=getchar ();//the input character is assigned to the variable
}
for(i=0; i<6; I++)
{
C=c [I] [I] + 4;//behind the input characters into a fourth
C [5]='\ 0';//end
Putchar (c [I]);
}
Putchar (" \ n "); }

Please help to see what is problem, thank you!
  • Related