C Language: Please compile the program to translate "China" into a password, respectively, with the Putchar and printf function output these 5 characters.

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.