Now , I want to have Lower triangle and Upper Triangle.
When using "upper.tri" , I am getting values in term True and False. I am not getting the values. And when I tried 'as.numeric' it gave me values as 1 and 0's.

set.seed(245183)
m = matrix(data = sample(1:100), nrow = 10, ncol = 10)
m[upper.tri(x = m, diag = TRUE)] = NA
print(m)

Yielding:

[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] NA NA NA NA NA NA NA NA NA NA
[2,] 44 NA NA NA NA NA NA NA NA NA
[3,] 37 26 NA NA NA NA NA NA NA NA
[4,] 1 48 84 NA NA NA NA NA NA NA
[5,] 50 67 66 85 NA NA NA NA NA NA
[6,] 27 77 42 30 31 NA NA NA NA NA
[7,] 79 4 73 16 29 100 NA NA NA NA
[8,] 62 87 97 32 89 88 70 NA NA NA
[9,] 69 76 25 54 14 49 47 21 NA NA
[10,] 5 52 3 86 75 2 60 64 61 NA

First, what is the value '245183' in set.seed?
Second, in Upper triangle, [1,1] should be same as before and values below column 1 except that should be zero. Similarly, [1,2] and [2,2] should be same as before and values below that should be zero. And so on.
Eg.,
u11 u12 u13
0 u22 u23
0 0 u33

In short, it ensures reproducible (pseudo) random number generation. I.e. so when you repeat my code, you will get the same numbers in the matrix. (For more, see here)

Make sure you understand what the line m[lower.tri(x = m, diag = FALSE)] = 0 does, i.e. in the m-matrix, select all elements in the lower triangle excluding the diagonal and replace them with the value 0

I want to obtain the same result this time, but without using formulas like upper.tri and lower.tri.
I know the code without this would be long but I want to know it to understand the whole thing.

set.seed(245183)
m = matrix(data = sample(1:100), nrow = 10, ncol = 10)
print(m)
# Loop thorugh i'th row and j'th column of m
for( i in 1:nrow(m) ){
for( j in 1:ncol(m) ){
# This doesn't do anything, but here you can think about how to check
# where in the matrix you are by checking the relative values of i and j
m[i,j] = m[i,j]
}
}