Halo ladies and gentleman , i gt problem with this C program can help me ?

Status
Not open for further replies.

ImBeck

Right off the assembly line
Write a program that prompts the user for an integer and then displays a pyramid of this height made up of hash (#) on the screen.
A sample run is as follows:
How height would you like the pyramid to be? 8

#
# #
# # #
# # # #
# # # # #
# # # # # #
# # # # # # #
# # # # # # # #
 

krishnandu.sarkar

Simply a DIGITian
Staff member
Re: halo ladies n gentleman , i gt problem with this program can help me ?

hey dude..................u didn't mentioned the language...............I'm posting the coding for the program in C...........if the language differs then take the idea n logic frm this......

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,n;
printf("Enter the length : ");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
printf("\n");
for(j=1;j<=i;j++)
{
printf(" #");
}
}
getch();
}
 

utsav

damn busy...
Re: halo ladies n gentleman , i gt problem with this program can help me ?

Use nested loop. 2 loops will do the work .run the loop from 1 to n whr n is the integer inputted . Try to do the rest of the homework urself :neutral: btw u should have mentioned the language to be used . How can u expect an answer when u havnt properly mentioned the question
 

Ecko

Wandering In Tecno Land
/*
Program to demonstrate
*
**
***
****
*****
******
*/

#include <stdio.h>
#include <conio.h>
main()
{
int i,j;
for(i=1;i<=8;i++)
{
for(j=1;j<=i;j++)
printf("*");

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

Replace Star with #
 

Faun

Wahahaha~!
Staff member
@OP
ask Master Chief and Covenants, they know the source code
though few floods may crept in as intermittent bigs during your playthrough.
 
*i38.tinypic.com/2uiyhix.jpg

*gigasmilies.googlepages.com/24.gif

No offence meant!! Peace!!
*gigasmilies.googlepages.com/24.gifR*gigasmilies.googlepages.com/24.gifO*gigasmilies.googlepages.com/24.gifF*gigasmilies.googlepages.com/24.gifL*gigasmilies.googlepages.com/24.gif
 

Hitboxx

Juke Box Hero
Oh grow up guys! As smart as you all are, keep the fun where it is, don't mock new users.

Mass infractions issued on T159, QwertyManiac, nish_higher, abh1shek and MetalheadGautham :D
 

Hitboxx

Juke Box Hero
At ImBeck, posts such as this are considered homework and are not entertained here. Since your first time here I assume, this is ok. Next time, please refrain. Learning any language obviously requires research and logic of your own.

And also, when you put up a question on a public medium like a forum on the internet, try to form proper English sentences, else you have already seen here how things go ;)
 
ya please accept my apologies too. I thought you were atleast entertained with this joke of ours, but I guess you took it too seriously. Have fun on this forum.
 

Hitboxx

Juke Box Hero
Heh, ok easy! There was a reason I put the smiley there. You're all forgiven except T159, His day will come :D

Thread won't serve anymore purpose. Closing!
 
Status
Not open for further replies.
Top Bottom