This is one of possible ways:

create or replace
function pwd_change(p_MOBNO varchar2) return boolean is
rm MOBUSER%rowtype;
n number;
begin
begin
select * into rm from MOBUSER where mobno = p_mobno;
exception when others then
-- some error handling
return false;
end;
if rm.password is null then
--
-- work with new user
-- (n new digit password)
--
n := dbms_utility.get_hash_value( p_MOBNO || to_char(sysdate), 8999, power(2,30)) + 1000;
update MOBUSER set password = to_char(n),
password1 = to_char(n),
status = 'NEW'
where mobno = p_mobno;
else
n := dbms_utility.get_hash_value( rm.password || to_char(sysdate), 8999, power(2,30)) + 1000;
update MOBUSER set password1 = to_char(n),
status = 'CHANGE'
where mobno = p_mobno;
end if;
return true;
end;
/

create or replace
trigger cng_password
after logon on database
begin
if user not in ('SYS', 'SYSTEM') then
if not pwd_change(user) then
-- this in not modno user
null;
else
-- this in mobno user (password changed)
null;
end if;
end;
/