operators - How do I print the percent sign(%) in c -


this question has answer here:

i beginner in c, , wondering why program not print % sign?

the code is:

#include<stdio.h>  main() {      printf("%");      getch(); } 

your problem have change:

printf("%");  

to

printf("%%"); 

or use ascii code , write:

printf("%c", 37); 

:)


Comments