answersLogoWhite

0

What is the C program codings for printing triangle?

Updated: 8/17/2019
User Avatar

Wiki User

15y ago

Best Answer

#include #include main() { int i,i=50,r=60; clrscr(); for(i=0;i<5;i++) { gotoxy(c,r); for(j=0;j<1;j++) { printf("* "); } c-=2; r+=2; } getch(); } NEW METHOD WITHOUT GRAPHICS... #include<stdio.h> #include<conio.h> main()

{

int row,i,n,star=1;

clrscr();

printf("Enter the no. of rows u want ");

scanf("%d",&n);

for(row=n;row>0;row--)

{

for(i=1;i<row-1;i++)

{

printf(" ");

}

for(i=1;i<=star;i++)

{

printf("*");

}

star=star+2;

printf("\n");

}

getch();

}

User Avatar

Wiki User

15y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the C program codings for printing triangle?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Where you get c codings?

u can get it on helpucode.blogspot.in daniweb.com


C plus plus codings for bank management?

yes


C program to find area of a triangle?

find the area of abc a[2,3] c[6,0]


Do I need a C plus plus program to print PASCAL's triangle?

No.


For loop program turbo c making a right triangle?

yes


Simple c language program?

Well, this is a very open question, please be specific, I will try try to answer this as well, a simple c language program can be any thing from printing your name on the screen to printing some patterns using symbols, or making a small game, or a simple calculator program. you can a clearer picture of what can be a simple c language program here:


What C program for display in triangle?

Please visit http://talentsealed.blogspot.com/2009/10/to-display-triangle-using-c-programming.html for the answer. Please let me know your comments


How can you start the program 'read in the lengths of the sides of a triangle and determine whether the triangle is an isosceles triangle two sides are equal an equilateral triangle three sides are'?

This would depend on what programming language you wanted to write it in. For example, in Pascal, the code might look like this: Program Isosceles; Var A, B, C : Real; Begin WriteLn('Input side A.'); ReadLn(A); WriteLn('Input side B.'); ReadLn(B); WriteLn('Input side C.'); ReadLn(C); If A = B Then Begin If B = C Then Begin WriteLn('This triangle is equilateral.'); End Else Begin WriteLn('This triangle is isosceles.'); And so on.


How do you write a program to find the area of a triangle?

The area of a triangle is one half base times height, so you would write a program to input the base and height, giving the option to stop, calculating and printing the area, and then looping to repeat as desired.


What is the side c of the triangle?

Side c of a triangle is opposite angle C


C program to find area and perimeter of triangle?

include #include#includevoid main(){int a,b,c:float s,A,x=1/2;clrscr();printf(" three sides of a triangle\n");scanf("%d %d %d",&a,&b,&c);s=(a+b+c)/2;A=pow((s(s-a)(s-b))(s-c)),x);printf("AREA OF TRIANGLE:%d\n"'A);gech();}


What has the author C L Burdick written?

C. L. Burdick has written: 'Colouring relief printing with the aerograph' 'Printing without printing rollers'