How to print % using printf()
How to print % in C Programming ?
To print any data on the output screen we use printf() function in C programming language. Using printf() we can print any character, symbol or number, but it seems a bit difficult to print % using printf(). If we simply write “%” in printf(), it will not print % and will show an error. For printing ‘%’, there is a specific format specifier i.e; “%%”, using this in printf() we can print %.
Lets see a example and understand how to print ‘%’ using “%%”
C Code for printing %
For printing % we use %%
Get over 200+ course One Subscription
Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others
Login/Signup to comment