---
title: "Discussion on \"Loop, Conditional, Modulus\" | Hashnode"
description: "Discussion on \"Loop, Conditional, Modulus\". Use the modulo operator %  and a for loop and if statement to print out all the even numbers from 1 to 100\npackage main\n\nimport (\n    \"fmt\"\n)\n\nfunc main() {\n    for i := 1; i <= 100; i++ {\n        if i%2 == 0 { // try changing the number to 3, 4, etc..."
url: "https://hashnode.com/posts/loop-conditional-modulus--deleted/6280e99b0094f2f13f516084"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Loop, Conditional, Modulus](https://blog.cloudnativefolks.org/loop-conditional-modulus--deleted?utm_source=hashnode&utm_medium=feed)

Use the modulo operator % and a for loop and if statement to print out all the even numbers from 1 to 100 package main import ( "fmt" ) func main() { for i := 1; i <= 100; i++ { if i%2 == 0 { // try changing the number to 3, 4, etc...

May 15, 2022 · 1 min read · blog.cloudnativefolks.org  
Updated May 16, 2022  
Read the article

-   [#go](https://hashnode.com/tag/go)

## Written by

[Sangam Biradar](https://hashnode.com/@sangambiradar)

@sangambiradar · India

  
[View profile](https://hashnode.com/@sangambiradar)

AI Security

DevRel at StackGen | Formerly at Deepfence ,Tenable , Accurics | AWS Community Builder also Docker Community Award Winner at Dockercon2020 | CyberSecurity Innovator of Year 2023 award by Bsides Bangalore | Docker/HashiCorp Meetup Organiser Bangalore &amp; Co-Author of Learn Lightweight Kubernetes with k3s (2019) , Packt Publication &amp; also run Non Profit CloudNativeFolks / CloudSecCorner Community To Empower Free Education reach out me twitterhttps://twitter.com/sangamtwts or just follow on GitHub -&gt; https://github.com/sangam14 for Valuable Resources

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
