summaryrefslogtreecommitdiff
path: root/48/CH2/EX2.1/eg_2_1.sce
blob: 21e773b095952a249b6c04364cbec1c1873a5e1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
clear;
clc;
//lower=input("input the lower limit of the set");
//upper=input("input the upper limit of the set");
lower=1;    //lower limit of the set 
upper=10;   //upper limit of the set
temp=lower;
h=1;i=1;
while(temp<=upper)
    if(modulo(temp,2)==0)       //checking whether a number is even or not
        e(h)=temp;
        h=h+1;
    else
        o(i)=temp;             //odd number 
        i=i+1;
    end
    temp=temp+1;
end;
disp("the set of even number between the limits")
disp(e);
disp("the set of odd number between the limits")
disp(o);