I am trying to make a program to print maximum of 5 numbers using for loop and taking number input from user.
I know I can do it via max command by having a =[1,2,3,4,5]; and max(a);.
But trying out with for loop.
I don't know how to take an array in Scilab (I know their is matrix that we can take but don't know how to take input from user in matrix or in array in Scilab)
`a = [1,2,3,4,5];` //works fine but i want user should input numbers.
I know one way is using
a = input("First number:");
b = input("Second number:"); ... and so on upto fifth number
// i want to make it short like using array in C language
int a[5];
printf("Enter numbers");
for(i=0;i<5;i++)
scanf("%d",&a[i]);
// Here in Scilab i don't know how i write it??
if I use int a[5]; i get error Undefined variable: a --error4
I know i can use mprintf & msscanf but question is i am not able to declare or take array data from user's end. Please suggest me some way to make this program.
Also how to declare & take matrix data from user and declare & take array data from user.