613 views
1 votes
1 votes
Function what(x, n:integer): integer:
Var
value : integer
begin
value := 1
if n > 0 then
begin
if n mod 2 =1 then
value := value * x;
value := value * what(x*x, n div 2);
end;
what := value;
end;

 

 

convert the code in c

Please log in or register to answer this question.

Related questions

19 votes
19 votes
3 answers
1
Kathleen asked Oct 5, 2014
2,695 views
What function of $x$, $n$ is computed by this program?Function what(x, n:integer): integer: Var value : integer begin value := 1 if n 0 then begin if n mod 2 =1 then val...
5 votes
5 votes
2 answers
2
Souvik33 asked Jan 15, 2023
1,095 views
Consider the function func shown below: int func(int num) { int count = 0; while (num) { count++; num>>= 1; } return (count); }The value returned by func(-435) is:69Will ...
13 votes
13 votes
4 answers
3
Arjun asked Feb 7, 2019
9,565 views
Consider the following C program :#include<stdio.h int jumble(int x, int y){ x = 2*x+y; return x; } int main(){ int x=2, y=5; y=jumble(y,x); x=jumble(y,x); printf("%d \n"...