w3resource logo


C Programming Exercises

C Exercises: Print a big C

Secondary Nav

C Basic Declarations and Expressions : Exercise-3 with Solution

Write a C program to print a big 'C'.

Expected Output :

    ######
  ##      ##
 #
 #
 #
 #
 #
  ##      ##
    ######

C Code:

#include <stdio.h> 
 int main() 
 {
   printf("    ######\n");
   printf("  ##      ##\n");
   printf(" #\n");
   printf(" #\n");
   printf(" #\n");
   printf(" #\n");
   printf(" #\n");
   printf("  ##      ##\n");
   printf("    ######\n");

	return(0);
}

 

Solution

#include <stdio.h> 
 int main() 
 {
   printf("    ######\n");
   printf("  ##      ##\n");
   printf(" #\n");
   printf(" #\n");
   printf(" #\n");
   printf(" #\n");
   printf(" #\n");
   printf("  ##      ##\n");
   printf("    ######\n");

	return(0);
}

Improve this sample solution and post your code through Disqus.



Join our Question Answer community to learn and share your programming knowledge.

Solve these problems:

Java: How to convert a string to an integer in Java?

C#: Loops in c#

SQL: JOIN using more than 5 tables