Enter a password and check whether the password is “fuji”. I so enter 2 numbers and calculate total and average. Otherwise display ‘Access denied’.
Program Password; Uses wincrt; VAR tot , avg, num_1,num_2 :Integer; Password:string; Begin Clrscr; Write (“enter password”); Readln (password); If (password = fuji) then Write (“enter num 1”); Readln (num_1); Write (“enter num 2”); Readln (num_2); tot:=num_1+num_2; Write (“total”); Write (tot); Else Write (“Access denied”); End. |