Q. Write a program to generate a following #'s triangle?
# | ||||
# | # | |||
# | # | # | ||
# | # | # | # | |
# | # | # | # | # |
Ans.
/* c program for symbol triangle*/
#include<stdio.h>
#include<conio.h>
int main()
{
int num,r,c;
printf("Enter loop repeat number(rows): ");
scanf("%d",&num);
for(r=1; num>=r; r++)
for(r=1; num>=r; r++)
{
for(c=1; c<=r; c++)
printf("#");
printf("\n");
}
getch();
}
getch();
return 0;
}
/*************OUTPUT**************
Enter loop repeat number(rows): 5
***********************************/
/*************OUTPUT**************
Enter loop repeat number(rows): 5
# | ||||
# | # | |||
# | # | # | ||
# | # | # | # | |
# | # | # | # | # |
***********************************/
print pattern of stars
ReplyDelete*
***
******
Your required star pattern source code at:
Deletehttp://cprogrammingcodes.blogspot.in/2012/10/star-pyramid-pattern.html
Get the marks of student and print the average marks...
ReplyDeleteplzzzzzzzzzz tell me urgently
Your required student gets marks, calculate percentage and division C program at:
Deletehttp://cprogrammingcodes.blogspot.in/2012/10/get-student-marks-and-calculate.html
*
ReplyDelete* *
* * *
* *
*
Plz tell me the source for this o/p
@Uma,
DeleteYour required program source code at:
http://cprogrammingcodes.blogspot.in/2012/11/star-pyramid.html
Design a program that will display a triangle using ‘*’ characters. The user is to be prompted to enter the number of rows to be displayed within the range 3-9, the
ReplyDeleteprogram should loop continuously using a do-while loop until a valid number of rows has been
entered.
1
ReplyDelete12
123
1234
@Ghazanfar,
Deleteyour required program source code at:
http://cprogrammingcodes.blogspot.in/2011/09/10design-numbers-tringle-pyramid.html
0000*
ReplyDelete000**
00***
0****
#include
Deletemain()
{
int i,j,k,n;
printf("Enter the number of rows");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(k=n;k>i;k--)
{
printf("0");
}
for(j=0;j<i;j++)
{
printf("*");
}
printf("\n");
}
}
hi there, i really2 need your help to print this output by using function prototype.
ReplyDelete*
**
***
#
##
*
**
***
#include
ReplyDeletemain()
{
int i,j,k,n;
printf("Enter the number of rows");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
/* for(k=1;k<i;k++)
{
printf(" ");
}*/
for(j=1;j<=i;j++)
{
printf("#");
}
printf("\n");
}
}
can you make the flowchart for "*" pyramid?..plz snd anyone
ReplyDeleteplease tell me its algorithm
ReplyDelete*
* *
* * *
* * * *
* * * * *