Output JBL in Block Letters with C Programming

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 2K views
jaydnul
Messages
558
Reaction score
15
All i have to do is write a program that will output my initials (JBL) in block letters.

This is what i have done:

Code:
#include <stdio.h>
void main()
{
printf("	 JJJJJJ  BBBBBBBB  LLL");
printf("	   JJ     BB    BB    LLL");
printf("	   JJ    BBBBBBB    LLL");
printf("	   JJ    BB    BB     LLL");
printf("      JJ JJ     BB    BB    LLLLLLLL");
printf("	JJJJJ    BBBBBBBB  LLLLLLLL");
}

Now this is wrong of course. When i execute, it will print the top line with the correct number of spaces, but after the first LLL it just goes wack. I assume it is because i am not telling it when to start a new line, right? If so, how do i do that? Also, could i just use 1 printf statement instead of 6?
Thanks
 
Last edited by a moderator:
Physics news on Phys.org
ahh perfect. Thank you. another problem i was having was i didn't know tab would act as a single space, so it was printing all messed up. Got it now. Thanks SteamKing