Functions
035_invariant.c File Reference

Go to the source code of this file.

Functions

void func (int p, int *q)
 

Function Documentation

void func ( int  p,
int *  q 
)
Invariant
i+j=p
Precondition
p>=0
Postcondition
*q=2^(p+1)

Definition at line 10 of file 035_invariant.c.

11 {
12  int j = p, k=1, i;
13  for (i=0; i<=p; i++) j--,k=k*2;
14  *q = k;
15 }
p
Definition: test.py:223