Please compile the program to translate "China" into a password, the law of the Code is: the original letter after the 4th letter instead of the original letter. Use the Putchar and printf functions to output these 5 characters, respectively.
Program:
#include <stdio.h>
int main ()
{
Char c1= ' C ', c2= ' h ', c3= ' i ', c4= ' n ', c5= ' a ';
C1 + = 4;
C2 + = 4;
C3 + = 4;
C4 + = 4;
C5 + = 4;
printf ("Output password with printf:%c%c%c%c%c\n", C1, C2, C3, C4, C5);
printf ("Output password with Putchar:");
Putchar (C1);
Putchar (C2);
Putchar (C3);
Putchar (C4);
Putchar (C5);
printf ("\ n");
return 0;
}
Results:
The output password with printf is: glmre
With Putchar output password is: Glmre
Please press any key to continue ...
This article is from the "Rock Owl" blog, please be sure to keep this source http://yaoyaolx.blog.51cto.com/10732111/1740254
C Language: Please compile the program to translate "China" into a password, respectively, with the Putchar and printf function output these 5 characters.