Professional Documents
Culture Documents
START
Count = 0
YES
Is age=99?
No
Write ‘Count’
No
Is age>=20?
STOP
Yes
Count = Count+1
Ans. 2:
1. Begin
2. Input number as N.
3. Initialize I with 1
4. Is I<=N, then goto step 4(a) else step 7.
a. Initialize J with 1
b. Is J<=N, then goto step 4 (b)(i) else step 5.
i. Calculate I*J and store in P
ii. Print ‘P’
c. Increment J by 1 and goto step 4 (b).
5. Start printing in the next line.
6. Increment I by 1 and goto step 4.
7. Stop.
Ans 3: Begin
Take variables nos=0, NA=0,NE=0
Take no of sheets and read the grades.
Do while nos<50
IF(grade=A)
Add 1 to NA
ELSE
IF(grade=E)
Add 1 to EA
ENDIF
Add 1 to NOS
END DO
Print NA+NE
END
Ans.4:
CONDITIONS:
Customer is wholesaler Y Y Y Y N N N
Customer is retail saler N N N N Y Y Y
Order<500 Y Y N N N Y N
Order>=500 N N Y Y Y N Y
Cash on delivery N Y N Y N Y Y
ACTIONS:
Discount 2% √ √ √ √
Discount 3% √ √ √ √
Discount 5% √ √ √ √
User-defined function
{
Local variable declaration
Executable statements
}
Ans 7.
Quantifiers are used to change the use of variables in terms of memory.
We have different quantifiers associated with each data type:
Quantifiers used with integers are: long, short, unsigned and unsigned
long.
Quantifiers used with characters are: long.
Quantifiers used with double are: long.
For more details of each quantifiers please refer your book.