Skip to content

Latest commit

 

History

History
82 lines (56 loc) · 2.34 KB

README.md

File metadata and controls

82 lines (56 loc) · 2.34 KB

Simple Golang Programs

Description

This repository contains a collection of simple Golang programs designed to demonstrate various programming concepts and functionalities. Each program is described below with its respective functionality and expected output.

Programs

Program 1: Conditional Branching

  • If the score is less than or equal to 40, the grade is D.
  • If the score is less than 61, the grade is C.
  • If the score is less than 81, the grade is B.
  • Otherwise, the grade is A.

Program 2: Output Example

  • Your score is 50.
  • Sorry, you did not pass.

Program 3: Odd Numbers

  • Displays odd numbers from 1 to 100.

Program 4: Triangle Area Calculator

  • Calculates the area of a triangle given the base and height.

Program 5: Character Count

  • Displays the number of characters in a string.
  • Example input: "Programmer".

Program 6: Triangle Area Calculation

  • Calculates the area of a triangle.

Program 7: Rectangle Area Calculator

  • Calculates the area of a rectangle given the length and width.

Program 8: Circle Area Calculator

  • Calculates the area of a circle with π = 3.14 and radius = 7.

Program 9: Even Numbers

  • Displays even numbers from 1 to 75.

Program 10: Days of the Week Array

  • Creates an array containing the names of the days from Monday to Sunday.
  • Example output: "Day 1 is Monday", "Day 2 is Tuesday", etc.

Program 11: Fibonacci Sequence

  • Displays the first 5 Fibonacci numbers with the first term = 6 and the second term = 9.

Program 12: Right-Angled Triangle

  • Creates a right-angled triangle using asterisks.

Program 13: Full Triangle

  • Creates a full triangle using asterisks.

Program 14: Simple Calculator

  • A basic calculator program.

Program 15: Rectangle Area Calculation

  • Calculates the area of a rectangle.

Program 16: Rectangle Area Calculation

  • Calculates the area of a rectangle.

Program 17: Trigonometric Functions

  • Calculates sine, cosine, and tangent angles.

Program 18: Density Calculation

  • Calculates density.

Program 19: Counting to One Million

  • Counts from 1 to 1,000,000 and displays the record.

Program 20: Cube Surface Area

  • Calculates the surface area of a cube.

Program 21: Odd Numbers

  • Displays odd numbers from 1 to 75.

Program 22: Input and Output

  • Demonstrates input and output operations.

Powered by Reza