c programe1
Post on 31-Mar-2015
61 Views
Preview:
DESCRIPTION
TRANSCRIPT
For More & Download Visit http://www.nectarkunj.byethost14.com/
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
1 2
1 2 3
1 2 3 4
1 2 3 4 5
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
2 2
3 3 3
4 4 4 4
5 5 5 5 5
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
2 1
3 2 1
4 3 2 1
5 4 3 2 1
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
5 4
5 4 3
5 4 3 2
For More & Download Visit http://www.nectarkunj.byethost14.com/
5 4 3 2 1
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
4 4
3 3 3
2 2 2 2
1 1 1 1 1
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
1 4
1 4 9
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
D D
C C C
B B B B
A A A A A
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
A B
A B C
A B C D
A B C D E
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();
}
top related