1 #include <stdio.h> 2 3 int main() 4 { 5 int i = 5; ✹ 6 printf("%d %d\n",i); / * wrong */ 7 return 0; 8 }View Code
trp@DESKTOP-ET7Q9JO:~$ gcc -o t1 t1.c t1.c: In function ‘main’: t1.c:6:17: warning: format ‘%d’ expects a matching ‘int’ argument [-Wformat=] 6 | printf("%d %d\n",i); | ~^ | | | intView Code
1 #include <stdio.h> 2 3 int main() 4 { 5 int i = 5, j = 6; ✹ 6 printf("%d\n",i, j); 7 return 0; 8 }View Code
trp@DESKTOP-ET7Q9JO:~$ gcc -o t2 t2.c t2.c: In function ‘main’: t2.c:6:12: warning: too many arguments for format [-Wformat-extra-args] 6 | printf("%d\n",i, j);View Code