0% found this document useful (0 votes)
2 views

include

The document contains a C program that prints a specific pattern using nested loops. It generates three distinct shapes using characters, where the first shape resembles the letter 'I', the second shape includes various symbols, and the third shape resembles the letter 'U'. The program utilizes conditional statements to determine when to print characters or spaces.

Uploaded by

shashwat79143
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

include

The document contains a C program that prints a specific pattern using nested loops. It generates three distinct shapes using characters, where the first shape resembles the letter 'I', the second shape includes various symbols, and the third shape resembles the letter 'U'. The program utilizes conditional statements to determine when to print characters or spaces.

Uploaded by

shashwat79143
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

#include<stdio.

h>
int main() {
int i,a,b,j,c,k;

for(b=1;b<=7;b++){
for(j=1;j<=7;j++){
if(b==1){
printf("I");
}

else if(b==1||b==7 || b==2&&j==4 || b==3&&j==4 || b==4&&j==4 || b==5&&j==4 || b==6&&j==4 || b==7&&j==4){


printf("I");
}
else
{
printf(" ");
}
}
printf("\n");
}

printf("\n");
for(a=1;a<=7;a++){
for(i=1;i<=7;i++){
if(a==1&&i==2||a==1&&i==3||a==1&&i==5||a==1&&i==6 ||a==2&&i==1||a==2&&i==4||a==2&&i==7||a==3&&i==1||a==3&&i==7
||a==4&&i==7||a==4&&i==1||a==5&&i==2||a==5&&i==6||a==6&&i==3||a==6&&i==5 ||a==7&&i==4){
printf("\3");
}
else
{
printf(" ");
}
}
printf("\n");
}

printf("\n\n");
for(c=1;c<=7;c++){
for(k=1;k<=7;k++){
if(c==7|| k==1||k==7){
printf("U");
}
else
{
printf(" ");
}
}
printf("\n");
}

return 0;
}

You might also like