Why does printf give me this result ^*C? - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Why does printf give me this result ^*C?


Hey, I'm just doing a tutorial and I'm wondering why its not working.
I need the user to enter two numbers in to an array and then take one away from the other!

#include


int main(void) {
int numbers[2], result;
printf("Enter two numbers:");
scanf("%2s", &numbers[2]);
result = numbers[0] - numbers[1];
printf("%2s", result);

}
Sign In or Register to comment.