Home >Backend Development >C#.Net Tutorial >C language implements automatic line wrapping when outputting 5 numbers

C language implements automatic line wrapping when outputting 5 numbers

王林
王林Original
2020-05-13 09:42:0223393browse

C language implements automatic line wrapping when outputting 5 numbers

The method is as follows:

......
n++
if(n%5==0&&n!=0)    //因为当n=0时,n%5,的值也是0,就也会转行,为了防止这种情况的发生,就用了&&
printf("\n");

Recommended tutorial: c language tutorial

The above is the detailed content of C language implements automatic line wrapping when outputting 5 numbers. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn