#C program not running

7 messages · Page 1 of 1 (latest)

wise path
#

I am a beginner and VSCode seems to output an error when i run the code

wispy jackalBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

#

@wise path

Screenshots!

Your message appears to contain screenshots but no code. Please send code and error messages in text instead of screenshots if applicable!

wise path
#

#include <stdio.h>

int main() {
int x, y;
printf("Input a number for each x and y to be swapped:\nx=");
scanf("%d", &x);
printf("\ny=");
scanf("%d", &y);
x = x + y;
y = x - y;
x = x - y;
printf("\nx=%d and y=%d", x, y);
return 0;
}

muted hull
#

The code works:
https://godbolt.org/z/3ME8eec7r
Must be something wrong in vscode.

wispy jackalBOT
#

This question is being automatically marked as stale.
If your question has been answered, run !solved.
If your question is not answered feel free to bump the post or re-ask.
Take a look at !howto ask for tips on improving your question.

wise path
#

!solved