Look at my example:
Code:
#include <stdio.h>
#include <stdlib.h>
#define SIZE 5 /* size of array */
int main(void)
{
int i, factor, arr[SIZE];
/* get the numbers */
for (i=0; i<SIZE; ++i)
scanf("%d",&arr[i]);
/* get the factor */
printf("Insert the factor: ");
scanf("%d",&factor);
/* multiply all them by factor */
for (i=0; i<SIZE; ++i)
arr[i] *= factor;
/* display array */
for (i=0; i<SIZE; ++i)
printf("%d ",arr[i]);
/* pause */
system("PAUSE");
/* exit */
return 0;
}
You have some problems in your code, like here:
Code:
for (i=0;i<N; ++i);
In this case you dont need to ; the for command, you just need to close it when you want a null loop.