mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-20 16:42:51 -06:00
compiler works on abs and fibonacci
This commit is contained in:
@@ -1,12 +1,20 @@
|
||||
int abs (int x){
|
||||
int y ;
|
||||
{
|
||||
if (x < 0){
|
||||
return 0 - x ;
|
||||
y = 0 - x ;
|
||||
}
|
||||
else return x ;
|
||||
else {
|
||||
y = x ;
|
||||
}
|
||||
}
|
||||
return y ;
|
||||
} ;
|
||||
int main () {
|
||||
int i ;
|
||||
i = abs (16);
|
||||
printf (int,i) ;
|
||||
return ;
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user