NickName:Anjana Indunil Ask DateTime:2022-12-10T13:46:36 Why is scanf in a for loop not working in visual studio. But it works dev c++? visual studio erro dev c++ this code is working in dev c++, ut not working visual studio. erro is Error C4996 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. code is... #include<stdio.h> int main() { int arr[5] = { 0 }; int i = 0; printf("Enter the number :"); for (i = 0; i < 5; i++) { scanf("%d", &arr[i]); } return 0; Copyright Notice:Content Author:「Anjana Indunil」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.Link to original article:https://stackoverflow.com/questions/74750685/why-is-scanf-in-a-for-loop-not-working-in-visual-studio-but-it-works-dev-c Answers