A program to swap values:
#include <stdio.h>
#include <conio.h>
void swap(int *a, int *b);
void main()
{
int a, b;
printf("Enter two numbers: ");
scanf_s("%d%d", &a, &b);
printf("Before swap\n");
printf("a = %d, b = %d\n", a, b);
swap(&a, &b);
printf("After swap\n");
printf("a = %d, b = %d", a, b);
}
void swap(int *a, int *b)
{
printf("Enter the swapped numbers: \n");
scanf("%d%d", a, b);
}

why should I use scanf_s here instead of scanf?
Why does this happen?
Thank you for your help.