1 / 3
Jan 2012

Every time i try to compile my program using c (gcc 4.3.2) I get wrong answer,
but the code works well in fedora 16 as well as on ideone.com.
Plz help.

include

int main()
{
int n, i, k = 0;

scanf ("%d", &n);

long int a[n], x, y;

for (i = 0; i < n; i++) 
{
	scanf ("%ld %ld", &x, &y);
	a[k] = x * y;
	k++;
}

printf ("\n");

for (i = 0; i < n; i++)
{
	printf ("%ld\n", a[i]);
}

return 0;

}

  • created

    Jan '12
  • last reply

    Jan '12
  • 2

    replies

  • 159

    views

  • 2

    users

Suggested Topics

Topic Category Replies Views Activity
C and C++ 0 14 6d

Want to read more? Browse other topics in C and C++ or view latest topics.