foo.c: In function 'main':
foo.c:11:2: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d",&N,&M);
^~~~~~~~~~~~~~~~~~~
foo.c:13:9: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&a[i]);
^~~~~~~~~~~~~~~~~
foo.c:15:5: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
{ scanf("%d",&b);
^~~~~~~~~~~~~~
foo.c:9:18: warning: 'num[4]' may be used uninitialized in this function [-Wmaybe-uninitialized]
int a[100000],b,num[4];
^~~