coding c++

heloo...can i ask something about my coding.......what is the means of it

printf("\n\n%6s%8s%9s%12s%12s\n","Colour","Band 1","Band 2","Multiplier","Tolarance");
printf("%6s%8s%9s%12s%12s\n","^^^^^^","^^^^^^","^^^^^^","^^^^^^^^^^","^^^^^^^^^");
printf("%6s%6s%9s%9s%14s\n","None","-","-","-","+-20%");
printf("%6s%6s%9s%12s%11s\n","Silver","-","-","10^(-2)","+-10%");
printf("%6s%6s%9s%12s%11s\n","Gold","-","-","10^(-1)","+- 5%");
printf("%6s%6s%9s%11s%11s\n","Black","-","0"," 10^(0)","-");
printf("%6s%6s%9s%11s%11s\n","Brown","1","1"," 10^(1)","-");
printf("%6s%6s%9s%11s%11s\n","Red","2","2"," 10^(2)","-");
printf("%6s%6s%9s%11s%11s\n","Orange","3","3"," 10^(3)","-");
printf("%6s%6s%9s%11s%11s\n","Yellow","4","4"," 10^(4)","-");
printf("%6s%6s%9s%11s%11s\n","Green","5","5"," 10^(5)","-");
printf("%6s%6s%9s%11s%11s\n","Blue","6","6"," 10^(6)","-");
printf("%6s%6s%9s%11s%11s\n","Violet","7","7"," 10^(7)","-");
printf("%6s%6s%9s%11s%11s\n","Grey","8","8"," 10^(8)","-");
printf("%6s%6s%9s%11s%11s\n","White","9","9"," 10^(9)","-");
printf("\n\n\n\t1. None\n\t2. Silver\n\t3. Gold\n\t4. Black\n\t5. Brown\n\t6. Red\n\t7. Orange\n\t8. Yellow\n\t9. Green\n\t10. Blue\n\t11. Violet\n\t12. Grey\n\t13. White\n");


That code uses printf() to print some strings.
%s is the format specifier for a string.

%6s prints a string with an output width of 6 characters.

See tutorial:
https://www.codingunit.com/printf-format-specifiers-format-conversions-and-formatted-output
Topic archived. No new replies allowed.