answersLogoWhite

0


Best Answer

#include<stdio.h>

void main()

{

int row,column,add,sub,h,noofrows,noofcolumns,j,finish;

printf("how many rows do you want in your triangle\n");

scanf("%d",&noofrows);

noofcolumns=noofrows-1;

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

{

for(column=-noofcolumns;column<=noofcolumns;column=column+1)

{

add=row+column;

sub=row-column;

if(add==1sub==1)

{

printf("*");

}

else

{

printf(" ");

}

}

printf("\n");

}

finish=((noofrows+noofrows)-1);

for(j=1;j<=finish;j=j+1)

{

printf("*");

}

scanf("%d",&h);

}

User Avatar

Wiki User

13y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

Let's suppose you want to draw a triangle using TurboC. Use graphics.h, see the included file bgidemo.c for examples.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How does one draw a triangle in C console?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you divide a triangle into 2 triangles and 2 trapezoids?

Let's assume the triangle has points A, B, and C. Method 1 (3 lines) Draw two lines across the triangle parallel to line segment AB. Now you have two trapezoids and one triangle. Draw another line from C to the any point on the closest of the two lines you just drew, splitting the triangle into two more triangles. Method 2 (2 lines) Draw one line across the triangle parallel to line segment AB. Now you have one trapezoid and one triangle. Draw a second line that passes through C and is perpendicular to AB, splitting the trapezoid into two trapezoids and the triangle into 2 triangles. Method 3 (3 lines) Draw one line from point C to any point on line segment AB. Then draw a line parallel to AC and one parallel to BC, but don't let them cross the line you just drew.


How do you draw a equilateral acute triangle?

An equilateral triangle MUST be acute. Draw a staright line AB. Take a compass and put its pin point at A and the pencil point at B. Draw an arc on one side of AB. Without disturbing the compass setting, move the pin point to B and draw another arc to intersect the first arc at C. Join CA and CB. Then ABC is an equilateral triangle.


Which point is outside of the triangle A. (2 , 6) B. (2 , 5) C. (2 , 7) D. (4 , 6)?

a. (2,6). you draw it on a graph (x,y) b. c. d. make the triangle, a. lies between b. and c.


What Are The steps used in the construction of an equilateral triangle inscribed in a circle?

Draw a circle using a compass. Then, without changing the compass setting, place its point on the circumference of the circle, at any point A, and draw two arcs to intersect the circumference at B and C. Move the compass to B and draw another arc to intersect the circumference at D; and then from C to E. ADE will be an inscribed equilateral triangle.


Can you console in more than one variable at once in c?

Yes, you can. You can pass an array of data to your console application.


How do you construct a triangle when the only measurements given are the length of the sides?

Draw a horizontal line AB equal to one of the side lengths. From A draw an arc of a circle of radius one of the remaining lengths. From B draw an arc of a circle of radius the third length. Where the arcs intersect is point C. Join AC and BC. Voila!


What is the side c of the triangle?

Side c of a triangle is opposite angle C


What is the right triangle if a12 and b13 what is c?

If the 13 is the longest side of that right triangle, then the missing side is 5 . If 'c' is the longest side of that right triangle, then the missing one is 17.692 (rounded).


How do you draw number THREE?

Like one backwards c on top of another backwards c.


How do you find one of the shorter sides of a right angled triangle knowing the hypotenuse and one of the shorter sides?

a^2 + b^2 = c^2 c= hypotenuse a and b are the legs (sides) of the triangle


In this triangle side AC 2 side BC 3 and side AB 4. Is triangle ABC a right triangle?

In right triangle ABC, angle C is a right angle, AB = 13and BC = 5 What is the length of AC? Draw the triangle to help visualize the problem.


Can you draw an equilateral triangle using a straightedge and compass?

Yes, it is quite simple.Draw a straight line segment, AB. Put the compass point at A and open it so that the pencil point is at B. Then draw an arc. Next, without changing the compass setting move it to B and draw another arc to cut the previous arc at C. [Actually there will be two points, one on either side of AB.] Using the straight edge, join AC and BC. Then ABC is an equilateral triangle.