+ 1
How to print percentage symbol '%' on console screen in C programming language? Select your choice...
1. printf("%"); 2. printf("%%"); 3. printf("\%"); 4. None
4 odpowiedzi
+ 4
seems like
int main() {
int x = 80;
printf("%d%%",x);
return 0;
}
would be the solution if that is all you want.
+ 2
Have you tried them out?
+ 1
printf("%c",37);
+ 1
In a real programming situation I would say 4. None. Although one of those options would work, you don't need the extra overhead in formatted print just to output a single character. More appropriate would be:
putc('%', stdout);