Star pattern program in C
Here we learn about the Print square and number star pattern program in c using the character data type. In another word, we input the character and Get output in Strict Format.
The hollow pattern is here (Learn)
Heart pattern program in C
#include <stdio.h> int main() { char shape[20][30]={ "...AAAAAAA........AAAAAA", "..AAAAAAAAA......AAAAAAAA", ".AAAAAAAAAAA....AAAAAAAAAA", "AAAAAAAAAAAAA..AAAAAAAAAAAA", "AAAAAAAAAAAAAAAAAAAAAAAAAAAA", "BBBBBBBBBBBBBBBBBBBBBBBBBBBB", "BBBBBBBBBBBBBBBBBBBBBBBBBBB", ".BBBBBBBBBBBBBBBBBBBBBBBBB", "..BBBBBBBBBBBBBBBBBBBBBBB", "...BBBBBBBBBBBBBBBBBBBBB", "....BBBBBBBBBBBBBBBBBBB", ".....BBBBBBBBBBBBBBBBB", "......BBBBBBBBBBBBBBB", ".......BBBBBBBBBBBBB", "........BBBBBBBBBBB", ".........BBBBBBBBB", "..........BBBBBBB", "...........BBBBB", "............BBB", ".............B"}; int i,j; for(i=0;i<20;i++){ for(j=0;j<30;j++){ if(shape[i][j]=='A' || shape[i][j]=='B') printf("*"); else printf(" "); } printf("\n"); } return 0; }
C program to print patterns of numbers and stars
Heart pattern using Character Data Type
May this program will help you in better understanding pattern programs using Character Data type in C.