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

C Programe1

The document contains 9 programs that print various patterns. Each program includes the code to print the pattern in C language using loops. The patterns include triangles of asterisks, numbers, letters, ascending and descending orders, and combinations of these. Each program contains the input and output pattern it produces.

Uploaded by

njpatel9
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
153 views

C Programe1

The document contains 9 programs that print various patterns. Each program includes the code to print the pattern in C language using loops. The patterns include triangles of asterisks, numbers, letters, ascending and descending orders, and combinations of these. Each program contains the input and output pattern it produces.

Uploaded by

njpatel9
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 7

Programe:-1

Write a programe for following output.


*
**
***
****
*****
Input:-
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,n=5;
clrscr();
for(i=0;i<n;i++)
{
for(j=0;j<=i;j++)
{
printf("*");
}
printf("\n");
}
getch();
}

Programe:-2
Write a programe for following output.
1
12
123
1234
12345
Input:-
#include<stdio.h>

For More & Download Visit http://www.nectarkunj.byethost14.com/


#include<conio.h>
void main()
{
int i,j,n=5;
clrscr();
for(i=0;i<n;i++)
{
for(j=0;j<=i;j++)
{
printf("%d ",j+1);
}
printf("\n");
}
getch();
}

Programe:-3
Write a programe for following output.
1
22
333
4444
55555
Input:-
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,n=5;
clrscr();

for(i=0;i<n;i++)
{
for(j=0;j<=i;j++)
{
printf("%d ",i+1);
}
printf("\n");

For More & Download Visit http://www.nectarkunj.byethost14.com/


}
getch();
}

Programe:-4
Write a programe for following output.
1
21
321
4321
54321
Input:-
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,n=5;
clrscr();
for(i=0;i<n;i++)
{
for(j=i;j>=0;j--)
{
printf("%d ",j+1);
}
printf("\n");
}
getch();
}

Programe:-5
Write a programe for following output.
5
54
543
5432

For More & Download Visit http://www.nectarkunj.byethost14.com/


54321
Input:-
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,n=5;
clrscr();

for(i=0;i<n;i++)
{
for(j=n;j>=n-i;j--)
{
printf("%d ",j);
}
printf("\n");
}
getch();
}

Programe:-6
Write a programe for following output.
5
44
333
2222
11111
Input:-
#include<stdio.h>
#include<conio.h>

void main()
{

int i,j,n=5;
clrscr();

For More & Download Visit http://www.nectarkunj.byethost14.com/


for(i=n;i>0;i--)
{
for(j=0;j<=5-i;j++)
{
printf("%d ",i);
}
printf("\n");
}
getch();
}

Programe:-7
Write a programe for following output.
1
14
149
1 4 9 16
1 4 9 16 25
Input:-
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,n=5;
clrscr();
for(i=0;i<n;i++)
{
for(j=0;j<=i;j++)
{
printf("%d ",(j+1)*(j+1));
}
printf("\n");
}
getch();
}

Programe:-8
Write a programe for following output.

For More & Download Visit http://www.nectarkunj.byethost14.com/


E
DD
CCC
BBBB
AAAAA
Input:-
#include<stdio.h>
#include<conio.h>

void main()
{

int i,j,n=5,k=69;
clrscr();

for(i=0;i<n;i++)
{
for(j=0;j<=i;j++)
{
printf("%c ",k);
}
k--;
printf("\n");
}
getch();
}

Programe:-9
Write a programe for following output.
A
AB
ABC
ABCD
ABCDE
Input:-

For More & Download Visit http://www.nectarkunj.byethost14.com/


#include<stdio.h>
#include<conio.h>

void main()
{

int i,j,n=5,k;
clrscr();

for(i=0;i<n;i++)
{
k=65;
for(j=0;j<=i;j++)
{
printf("%c ",k);
k++;
}

printf("\n");
}
getch();
}

For More & Download Visit http://www.nectarkunj.byethost14.com/

You might also like