Question: if Z is a data type that can store all integers (-, ), what is the return value of the following frz function if given

if Z is a data type that can store all integers (-∞, ∞), what is the return value of the following frz function if given input n = 42100?

22. function frz (n : z) z; 23. var 24. array [0..9]

22. function frz (n : z) z; 23. var 24. array [0..9] of z = (43,503, 3, 3, 69,103, 3,2,7); holyNumbers : cnt, ret, i : 25. z; 26. begin 27. ret := 1; 28. for i:=0 to 9 do begin 29. cnt := 0; 30. while (n mod holyNumbers [i]) = 0 do begin 31. cnt := cnt + 1; 32. n := n div holyNumbers [i]; 33. end; 34. ret := ret* (cnt+1) ; 35. end; 36. frz := ret; 37. end;

Step by Step Solution

3.54 Rating (161 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Longint can store integers from 2147483648 to 2147... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!