int main{printf("%%%%"); return 0;} | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

int main{printf("%%%%"); return 0;}

Why output of this program would be '%%'

2nd May 2020, 12:01 PM
Arnab Pratihar
Arnab Pratihar - avatar
1 Answer
+ 2
C compiler treats % as format specifier in printf so to print % using printf u have to use %% so printf("%%%%") outputs %% Similarly for %% it outputs % for %%%%%% it outputs %%%
2nd May 2020, 1:23 PM
Nandan
Nandan - avatar