

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Golang Program to Read Two Numbers and Print their Quotient and Remainder
To print the Quotient and Remainder of two numbers, we can use the division operator and the modulo operator.
Let's take an Example:
- a = 15 and b = 2
- Quotient is 15/2 = 7
- Remainder is 15 % 2 = 1
Steps
- Define the variables, a and b.
- Use print statement for the first number.
- Use print statement for the second number.
- Find the division of the numbers, a and b.
- Find the remainder of the numbers, a and b.
- Print the calculated division.
- Print the calculated remainder.
Example
package main import "fmt" func main(){ var a, b int fmt.Print("Enter first number: ") fmt.Scanf("%d", &a) fmt.Print("Enter second number: ") fmt.Scanf("%d", &b) quotient:=a/b remainder:=a%b fmt.Println("Quotient is:",quotient) fmt.Println("Remainder is:",remainder) }
Output
Enter first number: 15 Enter second number: 7 Quotient is: 2 Remainder is: 1
- Related Questions & Answers
- Python Program to Read Two Numbers and Print Their Quotient and Remainder
- Java program to compute Remainder and Quotient
- C++ Program to Find Quotient and Remainder
- C Program to Compute Quotient and Remainder?
- Java Program to Compute Quotient and Remainder
- Program to find Quotient and Remainder in Java
- C++ Program for quotient and remainder of big number
- Golang Program to Read a Number (n) and Print the Natural Numbers Summation Pattern
- Return element-wise quotient and remainder simultaneously in Python Numpy
- Golang Program to Read Three Digits and Print all Possible Combinations from the Digits
- C# program to accept two integers and return the remainder
- Golang Program to check if two numbers are Amicable Numbers
- Python Program to Read a Number n and Print the Natural Numbers Summation Pattern
- Golang Program to Print the Sum of all the Positive Numbers and Negative Numbers in a List
- Golang Program to Print Odd Numbers Within a Given Range
Advertisements