Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
Articles by prashanth nallla
1 articles
Golang Program to Generate all the Divisors of an Integer
StepsTake the value of the integer and store it in a variable.Use a for loop and an if statement to generate the divisors of the integer.Print the divisors of the number.Enter an integer:25The divisors of the number are:1525The divisors of the number are: 2012451020ExplanationUser must first enter the value and store it in a variable.Use a for loop to generate numbers from 1 to n.Using an if statement, check if the number divided by i gives the remainder as 0 which is basically the divisor of the integer.Print the divisors of the number.Example Live Demopackage main import "fmt" func main(){ ...
Read MoreShowing 1–1 of 1 articles
« Prev
1
Next »
Advertisements