Click here to Skip to main content
15,867,985 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

Can anybody help me out to solve this problem.I am not that much expert in C.
Problem is:

the pattern given below using single printf statement
  XX     XX
   XX   XX
    XX XX
     X X
     X X
   XX   XX
  XX     XX
XX         XX
Posted
Updated 26-Oct-10 23:12pm
v2
Comments
Rajesh Anuhya 27-Oct-10 5:00am    
R U going to print "X" symbol using character 'X'??
KIDYA 27-Oct-10 5:05am    
Hi Rajesh,

Yes I want it using X Character.

1 solution

C++
printf("  XX     XX\n   XX   XX\n    XX XX\n     X X\n     X X\n   XX   XX\n  XX     XX\nXX         XX\n");


or, if you prefer:

C++
printf(
   "  XX     XX\n"
   "   XX   XX\n"
   "    XX XX\n"
   "     X X\n"
   "     X X\n"
   "   XX   XX\n"
   "  XX     XX\n"
   "XX         XX\n");
 
Share this answer
 
Comments
KIDYA 27-Oct-10 5:22am    
Thanks!!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900