0
 #include <stdio..h>
 main() {
int a,b;
scanf("%d%d",&a,&b);
printf("%d + %d = %d\n", a, b, a+b);
printf("%d - %d = %d\n", a, b, a-b);
printf("%d / %d = %d\n", a, b, a/b);
printf("%d * %d = %d\n", a, b, a*b);
printf("%d % %d = %d\n", a, b, a+b);
}

If you look at the last line in this code, you want to print%, but% does not. Please let me know if %% is correct

김아연
  • 1
  • 1

1 Answers1

1

You can print a literal % using %%.

C11 (ISO/IEC 9899:201x) §7.21.6.1 8:

%

A % character is written. No argument is converted. The complete conversion specification shall be %%.

S.S. Anne
  • 15,171
  • 8
  • 38
  • 76