#include
#include
void main(){
int i,j;
clrscr();
for(i=1;i<=5;i++){ for(j=1;j<=i;j++){ printf(" %d",i); } printf("\n"); } getch(); }
Program to print Pyramid of Numbers.
Labels:
C Assignments
Subscribe to:
Post Comments (Atom)
If you face any Problem in viewing code such as Incomplete "For Loops" or "Incorrect greater than or smaller" than equal to signs then please collect from My Web Site CLICK HERE
More Useful Topics... |
|
History Of C..
In the beginning was Charles Babbage and his Analytical Engine, a machine
he built in 1822 that could be programmed to carry out different computations.
Move forward more than 100 years, where the U.S. government in
1942 used concepts from Babbage’s engine to create the ENIAC, the first
modern computer.
Meanwhile, over at the AT&T Bell Labs, in 1972 Dennis Ritchie was working
with two languages: B (for Bell) and BCPL (Basic Combined Programming
Language). Inspired by Pascal, Mr. Ritchie developed the C programming
language.
he built in 1822 that could be programmed to carry out different computations.
Move forward more than 100 years, where the U.S. government in
1942 used concepts from Babbage’s engine to create the ENIAC, the first
modern computer.
Meanwhile, over at the AT&T Bell Labs, in 1972 Dennis Ritchie was working
with two languages: B (for Bell) and BCPL (Basic Combined Programming
Language). Inspired by Pascal, Mr. Ritchie developed the C programming
language.
My 1st Program...
#include
#include
void main ()
{
clrscr ();
printf ("\n\n\n\n");
printf ("\t\t\t\"Life is Good...\"\n");
printf ("\t\t\t********************************");
getch ();
}
Next Step...
#include
#include
void main ()
{
clrscr ();
printf ("\n\n\n\n\n\n\n\n");
printf ("\t\t\t --------------------------- \n\n");
printf ("\t\t\t | IGCT, Info Computers, INDIA | \n\n");
printf ("\t\t\t --------------------------- ");
}
how to print this one
ReplyDelete1
123
12345
1234567
12345
123
1
#include
Deleteint main()
{
int r,s,st,n,m;
int nst=n;
printf("Enter a number");
scanf("%d",&n);
for(m=0;m<2;m++)
{
if(m==0){
for(r=1;r0;r--)
{
for(s=n-r;s>0;s--)
{
printf("");
}
for(st=1;st<=2*r-1;st++)
{
printf("%d",st);
printf(" ");
}
printf("\n");
}
}
}
}
how to print the following
ReplyDelete------1
----2 --2
---3 -3 -3
n so on...
#include
Delete#include
Void main()
{
int i,j,s;
clrscr();
for(i=1;i<=5;i++); // Maintains Rows
{
for(s=1;s<=5-i;s++); // Maintain Spaces
{
printf(" "); // Print One Space
}
for(j=1;j<=i;j++); // Maintains Columns
{
printf("%d",i);
}
printf("\n");
}
getch();
}
OUTPUT :
----------
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
";
Delete}
}
$num=5;
printstar($num);
?>
how to print the following
ReplyDelete------1
-----21
----321
---4321
--54321
how to print
ReplyDelete1234567890
1234 7890
123 890
12 90
1 0
how to print
ReplyDelete----4
---44
--444
-4444
44444
how to print
ReplyDelete4444
-444
--44
---4
Dear friends if you Want any Solution Please Mail Me so that i will mail you solution, as i dont know ur E-Mail ID i cant help you...
ReplyDeletehow to print
ReplyDelete1
1 2 1
1 2 3 2 1
1 2 3 4 3 2 1
how to print
ReplyDelete-------1
-----1 2 1
---1 2 3 2 1
-1 2 3 4 3 2 1
1_ _ _1
ReplyDelete23_ _32
456 654
Please Give your E-Mail ID so that we will send you Solution by E-mail...Thanks...
ReplyDeleteThis comment has been removed by the author.
Deletenaseeb615@gmail.com
Deletepllxxx help me to make it ...
Write a program that prints the following pattern where n is taken as input:
n = 2
1
21
n = 3
1
21
321
n = 4
1
21
321
4321
And so on…
hiiii
ReplyDeletei want to make this program.
1
1 0 1
1 0 0 0 1
my id is gyanesh.niit@gmail.com
it has to be in pyramid only...so please help me out....
ReplyDeletehiiii
ReplyDeletei want to make this program.
----1
--1 0 1
1 0 0 0 1
my id is gyanesh.niit@gmail.com
how can we print this
ReplyDelete1
0 1
1 0 1
0 1 0 1
1 0 1 0 1
plz send me on my id
satan_bikalpa45@yahoo.com
how can we print this
ReplyDelete1
0 1
1 0 1
0 1 0 1
1 0 1 0 1
plz send me on my id
anshita.sharma@yahoo.co.in
#include
Delete#include
void main()
{
int i,j,k;
for(i=1;i<=5;i++)
{
if(i%2==0)
{
k=1;
}
else
{k=0;}
for(j=1;j<=i;j++)
{
if (k==1)
{
k=0;
}
else
{k=1;}
cout<<k;
}
cout<<endl;
}
getch();
}
-------1
ReplyDelete-----1 2 1
---1 2 3 2 1
-1 2 3 4 3 2 1
can anyone help me to print this..
ma email id is lakshmi.saki@gmail.com
how to print
ReplyDelete1
12
123
1234
12345
#include
ReplyDelete#include
void main()
{
int c=0,i,j,n;
clrscr();
printf("Enter The Number of lines to be created....");
scanf("%d",&n);
printf("\n............................................");
for(i=0;i<=n;i++)
{
printf("\n");
for(j=0;j<i;j++)
{
c=c+1;
printf(" %2d",c);
}
}
getch();
}
Output:-
Enter The Number Of Lines To be created...5
............................................
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
#include
Deleteint main()
{
int r,s,st,n,m=1;
int nst=n;
printf("Enter a number");
scanf("%d",&n);
for(r=1;r<=n;r++)
{
for(s=1;s<=n-r;s++)
{
printf("");
}
for(st=1;st<=r;st++)
{
printf("%d",m++);
printf(" ");
}
printf("\n");
}
}
i tried the following program
ReplyDelete#include
#include
void main()
{
int c=0,i,j,n;
clrscr();
printf("Enter The Number of lines to be created....");
scanf("%d",&n);
printf("\n............................................");
for(i=0;i<=n;i++)
{
printf("\n");
for(j=0;j<i;j++)
{
c=c+1;
printf(" %2d",c);
}
}
getch();
}
but i am getting the output as
1
2
3
4
5
6
instead of
1
23
456
78910
any one please send me the program to my mail id.
vamsimanoj29@gmail.com
hi i want code for follwing output
ReplyDelete1
23
456
78910
can any one provide my email id is chandankumar48968@gmail.com
hi i want code for following output
ReplyDelete1
232
34543
4567654
567898765
can any one provide to my email id hemaa.cse@gmail.com
* * * * *
ReplyDelete* * * *
* * *
* *
*
* *
* * *
* * * *
* * * * *
how to print this?
1
ReplyDelete1 2 1
1 2 3 2 1
1 2 3 4 3 2 1
1 2 3 4 5 4 3 2 1
can u please let me know how to print this in C++? thanks alot (nimashi_p@hotmail.com)
How to print the following>?? can anybody help???
ReplyDelete1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
16 17 18 19 20 21
#include
Deleteint main()
{
int r,s,st,n,m=1;
int nst=n;
printf("Enter a number");
scanf("%d",&n);
for(r=1;r<=n;r++)
{
for(s=1;s<=n-r;s++)
{
printf("");
}
for(st=1;st<=r;st++)
{
printf("%d",m++);
printf(" ");
}
printf("\n");
}
}
1
ReplyDelete23
456
78910
how to print
ReplyDelete1
1 2 1
1 2 3 2 1
1 2 3 4 3 2 1
my email is rahults87@gmail.com
How to print
ReplyDelete1
2 3 2
3 4 5 4 3
4 5 6 7 6 5 4
5 6 7 8 9 8 7 6 5
&
* * * * * * *
* * * 0 * * *
* * 0 0 0 * *
* 0 0 0 0 0 *
How to print this in c#
ReplyDelete1
2 3 2
3 4 5 4 3
4 5 6 7 6 5 4
5 6 7 8 9 8 7 6 5
&
* * * * * * *
* * * 0 * * *
* * 0 0 0 * *
* 0 0 0 0 0 *
my Email id:- mailtoprachi_patil@rediff.com
how to print
ReplyDelete1 2 3 4 5
1 2 3 4
1 2 3
1 2
1
how to print
ReplyDelete1 2 3 4 5
1 2 3 4
1 2 3
1 2
1
#include
Delete#include
main()
{
int i,j;
clrscr();
for(i=5;i>=1;i--)
{
for(j=1;j<=i;j++)
{
printf("%3d",j);
}
printf("\n");
}
getch();
}
#include
Deleteint main()
{
int r,s,st,n,m=1;
int nst=n;
printf("Enter a number");
scanf("%d",&n);
for(r=n;r>0;r--)
{
for(s=n-r;s>0;s--)
{
printf("");
}
for(st=1;st<+r;st++)
{
printf("%d",st);
printf(" ");
}
printf("\n");
}
}
i want the program for
ReplyDelete456
23
1
I want the coding for the following output:
ReplyDelete1
121
12321
plz reply on this id : zip_zap997@yahoo.com
-------1
ReplyDelete-----1 2 1
---1 2 3 2 1
-1 2 3 4 3 2 1
can anyone help me to print this..
ma email id is "chilly_eng@yahoo.com"
dfsfsd
ReplyDeletehi can u plz tell how to print foll
ReplyDelete1
1 2 A
1 2 3 A B
1 2 3 4 A B C
my email ID is shineg99@ymail.com
o/p:
ReplyDelete*****
****
***
**
*
*
**
***
****
*****
#include
int main()
{int i,j;
for(i=1;i<=5;i++)
{for(j=i;j<=5;j++)
printf("*",j);
printf("\n");
}
for(i=1;i<=5;i++)
{for(j=1;j<=i;j++)
printf("*",j);
printf("\n");
}
}
how to create this one
ReplyDelete1
23
456
78910
my email is jayrichbausa@ymail.com
anybody please help........
ReplyDeleteplease help me how to generate this pattern:
ReplyDelete4321
321
21
1
my email address is lc_111190@rocketmail.com
IF ANY ONE GET SOLUTION PLZ SEND TO ME ALSO.
DeleteID IS ASACHAN2707@GMAIL.COM
how to print dis:
ReplyDelete123
894
765
#include
Deleteint main()
{
int a[10][10]={0},i,j,low=0,top=9,n=1;
for(i=0;i<5;i++,low++,top--)
{
for(j=low;j<=top;j++,n++)
a[i][j]=n;
for(j=low+1;j<=top;j++,n++)
a[j][top]=n;
for(j=top-1;j>=low;j--,n++)
a[top][j]=n;
for(j=top-1;j>low;j--,n++)
a[j][low]=n;
}
printf("\t\t\t\tPerfect Square\n");
for(i=0;i<10;i++)
{
printf("\n\n\t");
for(j=0;j<10;j++)
{
printf("%6d",a[i][j]);
delay(300);
}
}
return 0;
}
hoe to get this one using while?
ReplyDelete*
***
*****
*******
*********
***********
pls email me scorpiotrisha09@yahoo.com
plz help me asap
3 digit number 123=1+2+3=6
ReplyDeletei want to make program for adition of 3digit no like this
my email id is siddharthbhatt666@gmail.com
IF YOU WANT LIKE DIS
Delete: 153 = 1*1*1 + 5*5*5 + 3*3*3
#include
using namespace std;
int main()
{
int armstrong=0,num=0,result=0,check;
cout<<"Enter Number to find it is an Armstrong number?";
cin>>num;
check=num;
for(int i=1;num!=0;i++){
armstrong=num%10;
num=num/10;
armstrong=armstrong*armstrong*armstrong;
result=result+armstrong;
}
if(result==check){
cout<<check<<" is an Armstrong Number";
}
else{
cout<<check<<" is NOT an Armstrong Number";
}
return 0;
}
how to print 1 as one and 2 as two ........upto n nos in c or c++
ReplyDeletehow to create this one ???????????
ReplyDelete1
2 3
4 5 6
7 8 9 10
plz do mail to arjunkneworld@gmail.com
what about this one
ReplyDelete-----*
----*-*
---*---*
--*-----*
-*-*-*-*-*
how to print
ReplyDelete1
2 2 2
3 3 3 3 3
4 4 4 4 4 4 4
Plz print this by using loops in c:
ReplyDelete1
2 3
4 5 6
7 8 9 10
send by mail plz.mail id is 'deepu.kashyap@hotmail.com'
#include
ReplyDelete#include
void main()
{
int i, j, k, c = 5;
for (i = 1; i <= 5; i++)
{
/* k is taken for spaces */
for (k = 1; k <= c; k++)
{
/* blank space */
printf(" ");
}
for (j = 1; j <= i; j++)
{
/* %2d ensures that the number is printed in
two spaces for alignment and the numbers are printed in the order. *
printf("%2d", i);
}
printf("\n");
/*c is decremented by 1 */
c--;
}
return 0;
}
You are asked to write a C++ program that reads a positive integer, greater than zero, from the user and then outputs a triangle of stars and numbers. The size of the triangle depends on the integer entered by the user. The first three rows should always be the same as in the example below (you have to find a suitable formula to print them) and again the rest of rows have numbers as in the example below.
ReplyDeleteExample, if the user enters the number 5 as input, the following triangle appears on the screen:
1
1 2
1 2 3
4 4 4 4
5 5 5 5 5
i am supposed to write a program with this structure:
while( )
{
if( )
{while or do loop ( )}
else
{while or do loop ( )}
my email is mac_mac4@hotmail.com
plz hurry i have to turn in my work :(
o/p
ReplyDelete1
1 2 1
1 2 3 2 1
#include
#include
main()
{
int i, j, k, space, n; // Decleare Variable
clrscr();
printf("Enter the Size: ");
scanf("%d", &n); // take input from user
for (i=1; i<=n; i++)
{
for (j=1; j<=n-i; j++)
printf(" ");
for (j=1,k=2*i-1; j<=2*i-1; j++,k--)
{
if (j <= k)
printf("%d", j);
else
printf("%d", k);
}
printf("\n");
}
getch();
}
output is like pyramid here..
DeleteThis comment has been removed by the author.
ReplyDeletehow to print this pattern through c language can any body help????
ReplyDelete*
**
***
****
*****
how to print this pattern through c language
ReplyDelete1
22
333
4444
55555
Hi i need a program coding for
ReplyDelete1
2 4
3 6 9
4 8 12 16
5 10 15 20 25
Please help me anybody,,!!
how to print
ReplyDelete______1
_____121
____13431
___1446441
plz help
Write a C program to display the following. (Hint: use 2 loops, 1 loop inside another loop) plzzz help
ReplyDelete**********
**********
**********
**********
**********
**********
**********
**********
**********
**********
how to print....
ReplyDelete- - - a
- - a b a
- a b c b a
a b c d c b a
how to print....
ReplyDelete1
22
123
4444
12345
please how to print....
1
ReplyDelete22
333
4444
55555
------------------------------
int num1;
int num2;
int Number;
Number = ReadIntPr("Enter a number: ");
for(num1=1; num1 <= Number; num1++)
{
for(num2=1; num2 <= num1; num2++)
WriteString(num1);
WriteString("\n");
}
i need the program for 0
ReplyDelete1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
1111111
ReplyDelete1A1AAAA
1AA1AAA
1AAA1AA
1AAAA1A
1AAAAA1
1AAAAAA
1111111
ReplyDelete1A1AAAA
1AA1AAA
1AAA1AA
1AAAA1A
1AAAAA1
1111111
creating pyramid of numbers is the basic lab c program used in many institutions. Thank you for sharing this program.
ReplyDeleteregards:
srinath reddy.
admin of Programming Tutorials for Beginners
This comment has been removed by the author.
ReplyDeletei need code for printing
ReplyDelete1
4 5
7 8 9
I need code for
ReplyDelete78910
456
23
1
Print
ReplyDelete123
894
765
How to print any name vertically,using pointers? In C??? Plz give me the code I'm using arry and it's runs but with pointer it's not working. 😕
ReplyDelete