Home > Uncategorized > Ambiguous Output In different Languages ( C,PHP,Ferite)

Ambiguous Output In different Languages ( C,PHP,Ferite)

Here is a code segment that output ambiguously in different languages.

In C:

#include

int test( int a, int b, int c , int d){

printf( "%d\n",a);
printf( "%d\n",b);
printf( "%d\n",c);
printf( "%d\n",d);

}

int main(){
int x = 100;
test(++x,++x,++x,++x);
return 0;
}

Output:
104
104
104
104

In PHP:


Output:
101
102
103
104

In ferite:

uses "console","array";

function test( number i, number j , number k, number l) {

Console.println(i);
Console.println(j);
Console.println(k);
Console.println(l);

}

number x = 100;
test(++x,++x,++x,++x);

Output:
104
104
104
104

Advertisements
Categories: Uncategorized Tags:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: