use std::io;

fn main() {
    //Mutablöe and not mutable
    let mut x:u8 = 5; 
    println!("Mutable x = {x}"); 
    x = 6;
    println!("Mutable x = {x}"); 
    println!(""); 
    
    //Tup variables.
    let x: (i32, f64, u8) = (500, 6.4, 1);
    let five_hundred = x.0;
    let six_point_four = x.1;
    let one = x.2;
    println!("Tup.0 = {five_hundred}"); 
    println!("Tup.1 = {six_point_four}"); 
    println!("Tup.2 = {one}"); 
    println!(""); 


    // Array Most c like definition
    let aa: [i32; 5] = [1, 2, 3, 4, 5];
    let first = aa[0];
    let second = aa[1];
    println!("Table AA fisrt : {first}");
    println!("Table AA secont : {second}");
    println!(""); 
    //

    // Array Accessing 
    let a = [1, 2, 3, 4, 5];

    println!("Please enter an array index.");

    let mut index = String::new();

    io::stdin()
        .read_line(&mut index)
        .expect("Failed to read line");

    let index: usize = index
        .trim()
        .parse()
        .expect("Index entered was not a number");

    let element = a[index];

    println!("The value of the element at index {index} is: {element}");


}
