kite patterns in c
/******************************************************************************
Online C Compiler.
Code, Compile, Run and Debug C program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include <stdio.h>
int main()
{
int i,j,k;
for(i=1;i<=6;i++){
for(j=1;j<=5;j++){
if(i==1||i==5) {
if(j==3) printf("*");
else printf(" ");
}
if(i==2||i==4||i==6) {
if(j>1&&j<5) printf("*");
else printf(" ");
}
if(i==3) {
printf("*");
}
}
printf("\n");
}
}
Online C Compiler.
Code, Compile, Run and Debug C program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include <stdio.h>
int main()
{
int i,j,k;
for(i=1;i<=6;i++){
for(j=1;j<=5;j++){
if(i==1||i==5) {
if(j==3) printf("*");
else printf(" ");
}
if(i==2||i==4||i==6) {
if(j>1&&j<5) printf("*");
else printf(" ");
}
if(i==3) {
printf("*");
}
}
printf("\n");
}
}
kite pattern in c
/******************************************************************************
Online C Compiler.
Code, Compile, Run and Debug C program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include <stdio.h>
int main()
{
int i,j,k;
for(i=1;i<=11;i++){
for(j=1;j<=9;j++){
if(i==1||i==9) {
if(j==5) printf("*");
else printf(" ");
}
if(i==2||i==8||i==10) {
if(j>3&&j<7) printf("*");
else printf(" ");
}
if(i==3||i==7||i==11) {
if(j>2&&j<8) printf("*");
else printf(" ");
}
if(i==4||i==6) {
if(j>1&&j<9) printf("*");
else printf(" ");
}
if(i==5) {
printf("*");
}
}
printf("\n");
}
}
Comments
Post a Comment