Find the number within 100 that is divisible by 7, each row shows 7, and then line-break displays

Source: Internet
Author: User

#!/bin/bash#  Initializes an intermediate variable mm=1for  ((i=1;i<=100;i++)) do         #  set the value of the intermediate variable temp1         let  "temp1=i%7"          if [  "$temp 1"  -ne 0 ]; then                 continue         fi        #  Input Results           echo -n  "$i  "          #  sets the value of the intermediate variable TEMP2, which is used for line wrapping         let  temp2=m%7          #  Show 7 numbers per row         if  [  "$temp 2"  -eq 0 ]; then                 echo  " "         fi         let  "m++"  done

The result is entered as:

7 14 21 28 35 42 49

56 63 70 77 84 91 98


This article is from the "Never Stop" blog, please be sure to keep this source http://wjcaiyf.blog.51cto.com/7105309/1690836

Find the number within 100 that is divisible by 7, each row shows 7, and then line-break displays

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.