0% found this document useful (0 votes)
21 views5 pages

Partho Sp Code (1)

Uploaded by

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

Partho Sp Code (1)

Uploaded by

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

CODE : Rectangular Pattern

#include<stdio.h>
int main()
{
int i,n,m;

printf("Enter Your Number:");


scanf("%d",&n);

for(i=0;i<n;++i)
{
for (m=0;m<n;++m)
{printf("*");

}
printf("*\n");}
return 0;
}

CODE : Triangle Pattern


int main()
{
int I,n,m;
printf("Enter Your Number:");
scanf("%d",&n);
for(i=0;i<=n+1;i++)
{
for (m=1;m<=i;m++){
printf("*");

}
printf("*\n");}
return 0;
}
CODE : Increasing and decreasing triangle Pattern
#include<stdio.h>
int main()
{ int i,n,m;
printf("Enter Your Number:");
scanf("%d",&n);
for(i=0;i<=n+1;i++)
{
for (m=n;m>=i;m--)
{printf("*");
}printf("*\n");}
for(i=0;i<=n+1;i++)
{
for (m=n;m>=i;m--)
{printf("*");
}
printf("*\n");}
for(i=0;i<=n+1;i++)
{
for (m=1;m<=i;m++){
printf("*");

}
printf("*\n");
return 0;
}
CODE : Reverse Triangle Pattern
#include<stdio.h>
int main()
{
int i,n,m;

printf("Enter Your Number:");


scanf("%d",&n);

for(i=0;i<=n+1;i++)
{

for (m=n;m>=i;m--)
{printf("*");

}
printf("*\n");}

return 0;
}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy