Rishikesh Kumar Rishi has Published 1156 Articles

Golang Program to Print the Multiplication Table of a Given Number

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 31-Jul-2021 15:35:29

1K+ Views

StepsRead a number and store it in a variable.Print the multiplication table of the given number.Enter the number to print the table for: 77 x 1 = 77 x 2 = 147 x 3 = 217 x 4 = 287 x 5 = 357 x 6 = 427 x 7 ... Read More

Golang Program to Take the Temperature in Celsius and Covert it to Farenheit

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 31-Jul-2021 15:33:13

493 Views

StepsTake the value of temperature in Celsius and store it in a variable.Convert it to Fahrenheit.Print the final result.Enter the temperature in Celsius: 32Temperature in Fahrenheit is: 89.6Enter the temperature in Celsius: 48Temperature in Fahrenheit is: 118.4ExplanationUser must first enter the value of temperature in Celsius.Using the formula: f=(c*1.8)+32, convert ... Read More

Golang Program to Convert Centimeters into Feet and Inches

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 31-Jul-2021 15:32:26

290 Views

StepsTake the height in centimeters and store it in a variable.Convert the height in centimeters into inches and feet.Print the length in inches and feet.Enter the height in centimeters: 50The length in inches: 19.7The length in feet: 1.64Enter the height in centimeters: 153The length in inches: 60.28The length in feet: ... Read More

Golang Program to Check Whether a Given Year is a Leap Year

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 31-Jul-2021 15:31:40

2K+ Views

StepsTake the value of the year as input.Using an if-statement, check whether the year is a leap year or notPrint the final result.Enter the year to be checked: 2016The year is a leap year!Enter the year to be checked: 2005The year isn't a leap year!ExplanationUser must first enter the year ... Read More

Golang Program to Print an Inverted Star Pattern

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 31-Jul-2021 15:30:43

320 Views

StepsTake a value from the user and store it in a variable, n.Use a for loop where the value of i ranges between the values of n-1 and 0 with a decrement of 1 with each iteration.Multiply the empty spaces with n-i and '*' with i and print both of ... Read More

Golang Program to Compute Simple Interest Given all the Required Values

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 31-Jul-2021 15:11:05

156 Views

StepsRead the values for principal amount, rate and time.Using the formula, compute the simple interest.Print the value for the computed interest.Enter the principal amount: 200Enter the time(years): 5Enter the rate: 5The simple interest is: 50Enter the principal amount: 70000Enter the time(years): 1Enter the rate: 4The simple interest is: 2800ExplanationUser must ... Read More

Golang Program to Print an Identity Matrix

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 31-Jul-2021 15:09:29

241 Views

The steps to print an identity matrix using Golang is as follows :Take a value from the user and store it in a variable, n.Use two for loops where the value of j ranges between the values of 0 and n-1 and the value of i also ranges between 0 ... Read More

Golang Program to Read a Number (n) and Print the Natural Numbers Summation Pattern

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 31-Jul-2021 15:07:59

270 Views

Let's suppose the number is: 4Then, the Summation Patten would be:1 = 11 + 2 = 31 + 2 + 3 = 61 + 2 + 3 + 4 = 10StepsTake a value from the user and store it in a variable, n.Use two for loops where the value of ... Read More

Goland Program to Read a Number (n) And Print the Series "1+2+…..+n= "

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 31-Jul-2021 15:05:51

122 Views

StepsTake a value from the user and store it in a variable (n).Use a for loop where the value of i ranges between the values of 1 and n.Print the value of i and '+' operator.Find the sum of elements in the list.Print '=' followed by the total sum.Exit.ExplanationUser must ... Read More

Golang Program to print all integers between a range that aren't divisible by either 2 or 3

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 31-Jul-2021 15:01:21

371 Views

Let's assume the range is from 0 to 50. We have to print all the integers that aren't divisible by either 2 or 3.StepsUse a for loop ranging from 0 to 50.Then, use an if statement to check if the number isn't divisible by both 2 and 3.Print the numbers ... Read More

Advertisements