Practical#08
SOURCE PROGRAM
10 REM FIND THE TOTAL NUMBER OF MALE AND FEMALE STUDENTS
20 CLS
30 FOR A= 1 TO 10
40 INPUT "ENTER NAME";N$(A)
50 INPUT "ENTER SEX";S$(A)
60 NEXT A
70 PRINT "S.NO", "NAME", "SEX"
80 LET M=0 : F=0
90 FOR B = 1 TO 10
100 PRINT B, N$(B), S$(B)
110 IF LEFT$(S$(B),1) = "F" THEN F = F + 1 ELSE M = M + 1
120 NEXT B
130 PRINT "TOTAL NUMBER OF MALE STUDENTS=:";M
140 PRINT "TOTAL NUMBER OF FEMALE STUDENTS=:";F
150 END
OUTPUT
S.NO NAME SEX
1 ABRAR MALE
2 FARHAN MALE
3 FARHAT FEMALE
4 QADIR MALE
5 FARNAZ FEMALE
6 TARIQ MALE
7 ALI MALE
8 TOOBA FEMALE
9 SHOAKAT MALE
10 ARZOO FEMALE
TOTAL NUMBER OF MALE STUDENTS=: 6
TOTAL NUMBER OF FEMALE STUDENTS=: 4
Monday, April 12, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment