#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

# BRACKEYS - Solution to C# Tutorial 02 Challenge

13»

• Member
```int num01;
int num02;
int num03;

Console.Write("imput a number: ");

num01 = Convert.ToInt32( Console.ReadLine() );

Console.Write("imput a second number: ");

num02 = Convert.ToInt32( Console.ReadLine() );

Console.Write("imput a third number: ");

num03 = Convert.ToInt32 ( Console.ReadLine() );

//Averege
int num04 = 3;

//Resul
int result = num01 + num02 + num03;
int averege = result / num04;

Console.WriteLine("The average between " + num01 + "+" + num02 + "+" + num03 + " is: " + averege);

//Exit

//I'm a bit late...
```
• Member
edited December 2021

KurRuppted (press f5 to run)

using System;

using System.Collections.Generic;

using System.Linq;

namespace MyApp // Note: actual namespace depends on the project name.

{

public class Program

{

public static void Main(string[] args)

{

//variables

double num01;

double num02;

double num03;

double result01;

double result02;

//welcome

Console.WriteLine("Hello, I will help you find \nthe average of three numbers!");

//inputs

Console.Write("Input a number: ");

num01 = Convert.ToDouble( Console.ReadLine() );

Console.Write("Now Input a SECOND Number: ");

num02 = Convert.ToDouble( Console.ReadLine() );

Console.Write("Now Input the LAST Number: ");

num03 = Convert.ToDouble( Console.ReadLine() );

// end

Console.WriteLine("Calculating");

result01 = num01 + num02 + num03;

result02 = result01 / 3;

Console.WriteLine("The result is " + result02 + ".");

}

}

}

https://github.com/KurRuppted/Brackey-Challenge-E02-Average-of-three-nums

• Member

mine:

using System;

namespace MyApp // Note: actual namespace depends on the project name.

{

internal class Program

{

static void Main(string[] args)

{

double num01;

double num02;

double num03;

Console.Write("input num01: ");

Console.Write("input num02: ");

Console.Write("input num03: ");

double stored = num01 + num02 + num03;

double awnser = (stored / 3);

Console.Write("the result is: " + awnser);

Console.ReadKey(); //wait before closing

}

}

}

• Member

Seems like it worked!

using System;

namespace New_Code

{

class Program

{

static void Main(string[] args)

{

double num01;

double num02;

double num03;

Console.Write("Input a number: ");

num01 = Convert.ToDouble( Console.ReadLine() );

Console.Write("Input second number: ");

num02 = Convert.ToDouble( Console.ReadLine() );

Console.Write("Input third number: ");

num03 = Convert.ToDouble( Console.ReadLine() );

double result = (num01 + num02 + num03) / 3;

Console.WriteLine("the result is " + result);

}

}

}

• Member

here's mine

using System;

namespace My_Code

{

class Program

{

static void Main(string[] args)

{

// average = (x + y + z) / 3

// Variables

double num01;

double num02;

double num03;

// Asking for user's input

Console.WriteLine("Input your first number: ");

num01 = Convert.ToDouble( Console.ReadLine() );

Console.WriteLine("Input your second number: ");

num02 = Convert.ToDouble( Console.ReadLine() );

Console.WriteLine("Input your third number: ");

num03 = Convert.ToDouble( Console.ReadLine() );

// Getting the average

double result = (num01 + num02 + num03) / 3;

Console.WriteLine("The average is: " + result);

// Wait Before Closing

}

}

}

• Member

So I think this is okay

• Member

is this good

using System;

namespace coding

{

class program

{

static void Main (string[] args)

{

//variables

double num1;

double num2;

double num3;

Console.Write("write a number:");

Console.Write("write a second number:");

Console.Write("write a third number:");

var r1 = num1 + num2 + num3;

var r2 = r1 / 3;

var result = r2;

Console.Write("the avrage:" + result);

}

}

}

• Member

Here is my code:

Here is the outcome:

• Member

double num01;

double num02;

double num03;

Console.Write("Input a number: ");

num01 = Convert.ToDouble( Console.ReadLine() );

Console.Write("Input a second number: ");

Console.Write("Input a third number: ");

double result = num01 + num02 + num03;

Console.WriteLine("The result is " + result / 3+ ".");

• Member

double num01;

double num02;

double num03;

Console.Write("Input a number: ");

num01 = Convert.ToDouble( Console.ReadLine() );

Console.Write("Input a second number: ");

num02 = Convert.ToDouble( Console.ReadLine() );

Console.Write("Input a third number: ");

num03 = Convert.ToDouble( Console.ReadLine() );

double result = (num01 + num02 + num03) / 3;

Console.WriteLine("The result is " + result);