Final PF Question
Final PF Question
Final PF Question
Total Pages
Question 1: Choose the right option from the following. [Marks = 1x8 = 8]
2. What is the scope of the variable declared in the user definied function?
4. Which of the following gives the memory address of the first element in array?
a) array[0]; c) array(2);
b) array[1]; d) array;
Page 1 of 4
Please turn over
Continued From Overleaf
a) b is assigned to a c) a is assigned to b
b) p now points to b d) q now points to a
Page 2 of 4
Please turn over
Continued From Overleaf
Given the below searching algorithm, how many times a while loop runs to find the values (12, 35, 56) one
by one in the given below data?
12 14 17 24 26 35 38 46 56 76
Page 3 of 4
Please turn over
Continued From Overleaf
Question 4 [10]
Design a structure named Employee. The structure should keep the following information of 100 employees in
member variables:
• Employee name
• Employee number
• Basic Salary
• Hiring year
• Net Pay
Write a function to calculate Net Pay of an employee on the basis of seniority. If the employee spent more than or
equal to 10 years, then he / she will get 60% bonus of the basic pay. If the employee spent more than 7 years but
less than 10 years, then he / she will get 40% bonus and 20% bonus for those who spent less than 5 years.
Page 4 of 4
Please turn over