Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# average of 3 numbers

// define a double with 3 parameters each being a number between 1 & 100 (ln 9)
static double avrg(double num1, double num2, double num3 ){
    double average = (num1 + num2 + num3) / 3;
    return average;
}
Random rnd = new Random();
// new random class

Console.WriteLine(avrg(rnd.Next(1, 101), rnd.Next(1, 101), rnd.Next(1, 101)));

// wait before closing
Console.ReadKey();
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# func with no return 
Csharp :: ubuntu: how to open the terminal from c# 
Csharp :: cs entity framework 
Csharp :: insert new item listview c# 
Csharp :: unity deactivate all colliders of a gameobject 
Csharp :: consecutive numbers c# 
Csharp :: pyqt qtableview get selected row data 
Csharp :: discord bot status code c# 
Csharp :: download file from url asp net web api c# 
Csharp :: unity new Color() 
Csharp :: c# initialize empty list 
Csharp :: how to move towards an object unity 
Csharp :: hello world c# 
Csharp :: c# object to dictionary 
Csharp :: new line console c# 
Csharp :: c# datagridview column size 
Csharp :: if statement swiftui 
Csharp :: create material unity script 
Csharp :: add object to list c# 
Csharp :: httpclient soap request c# 
Csharp :: how to make a custom cursor in windows forms c# 
Csharp :: parse json array c# 
Csharp :: how to do time.deltatime in c# 
Csharp :: what is public static void 
Csharp :: how to destroy a gameobject in c# 
Csharp :: string isnullorempty vs isnullorwhitespace 
Csharp :: how to install jdk on linux manjaro 
Csharp :: unity event 
Csharp :: assign color to value in c# 
Csharp :: foreach enum 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =