Get the App
SLTechnology News&Howtos  ›  Development  › 

How does C language cycle odd or even numbers in an interval?

Shulou Source: shulou.com Published: 2022-06-01 01:50:53 10月02日 Update

This article mainly introduces the relevant knowledge of "how C language circulates odd or even numbers in the interval". The editor shows you the operation process through practical cases, and the operation method is simple, fast and practical. I hope this article "how to cycle odd or even numbers in C language range" can help you solve the problem.

The odd / even numbers in the range of cyclic output can be judged by the remainder divided by 2.

The following example outputs the even number of the specified range by looping.

Example

# include

Int main () {

Int i

For (I = 1; I

Tags: Even interval range loop odd language knowledge example industry output different practical remainder content can be passed practical practical articles methods more Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Shulou Technology Shulou Information Shulou Tech Info MariaDB