52.
Input the age of a person and find out whether the person can cast
vote or not using sub procedure. [age >=18]
DECLARE FUNCTION CHECK$
(A)
CLS
INPUT “ENTER YOUR AGE”; A
PRINT “YOU ARE “; CHECK$(A)
END
FUNCTION CHECK$ (A)
IF A >= 18 THEN
CHECK$ = “ELIGIBLE TO
VOTE”
ELSE
CHECK$ = “ NOT ELIGIBLE TO
VOTE”
END IF
END FUNCTION
i wanted to clear my doubt that while using the IF..ELSE statement not the IF..THEN...ELSE statement while we are ending the writing of the program we need to directly write END statement or we need to write
ReplyDeleteEND IF
END please make me clear about that!!
END please make me clear about that !!
IT DEPENDS
DeleteHOW THE QN IS
FOR EX: IF QN ASK U
WAP TO PRINT WHETHER GIVEN NUUMBER IS EVEN OR ODD
THEN
REMEMBER IF WHETHER IS ADDED IN THE QN THEN DEFINETLY THERE U WILL USE IF
AND FOR ENDING
U HAVE TO USE ENDIF
END
OTHERWISE IT WON'T WORK
U MAY CHECK
GRADE:8
There is a choice like if you use "IF" then you need to write "End IF". But if you are not writing "IF" then you need not write to "End If".(Note:You need to care through which procedure you are writing program then you will be clear from doubt)
ReplyDeleteThank u I really need help for my exam
ReplyDelete