answersLogoWhite

0


Best Answer

#include
#include
void main()
{
int n,a=1,s=1,r;
printf("\n enter number of lines ");
cin>>n;

for(;a<=n;s=s*10+1)
{
for(b=n-a;b>=1;b--)
{
printf(" ");
}
r=pow(s,2);
printf("\n");
a++;
}

getch();
}// \m/

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Implimentation of pascle triangle in C?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Write a program in c to display isosceles triangle dy digit?

#include&lt;stdio.h&gt; #include&lt;conio.h&gt; void main() { int a,b,c; clrscr(); printf("\n Enter the 3 sides of Triangle: "); scanf("%d %d %d",&amp;a,&amp;b,&amp;c); printf("\nYour entered side is a=%d b=%d c=%d",a,b,c); if(a==b &amp;&amp; b==c &amp;&amp; a==c) { printf("\n EQUILATERAL TRIANGLE.");//All sides equal in case of Equilateral triangle } else if(a!=b&amp;&amp;b!=c) printf("\n SCALENE TRIANGLE."); //All sides unequal else printf("\n ISOCELES TRIANGLE."); //At least 2 sides equal getch(); }


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.


D Write a program that reads 3 sides of a triangle and calculates the perimeter of the triangle and the area using the formulae?

//Written in C++. ALFRED OMONDI ORIMBO (orimbo@gmail.com)# include# includeusing namespace std;void main(){double s,a,b,c,area;couta;coutb;coutc;s=(a+b+c)/2;area = sqrt(s*(s-a)*(s-b)*(s-c));cout


How do you write a Turbo C plus plus program that reads sides of triangle?

You write it exactly the same as you would write it in any other verions of C++, by taking user input to determine the three sides of your triangle. In other words, input three real numbers. What you do with those three numbers is entirely up to you, but presumably you'd want to calculate the angles of a triangle given the length of its three sides. For that you would need to use the cosine rule which states that for any triangle with angles A, B and C whose opposing sides are a, b and c respectively, cos A = (b2 + c2 - a2)/2bc and cos B = (c2 + a2 - b2)/2ca. Knowing two angles, A and B, you can easily work out that angle C must be 180 - (A + B).


Write a program to make a triangle?

To draw a random triangle.... Declare six variables.... H1 and V1 H2 and V2 H3 and V3 Then using the random function apply the random to the height of your form - this will be H1 Do the same with the width of the form - this will be V1 -- do this twice more, for H2 and V2 - and then for H3 and V3.. Then draw a line from (H1, V1) to (H2, V2) Draw another line from (H1, V1) to (H3, V3) Draw the last line from (H2, V2) to (H3, V3) -- I can't guarantee it will look great, but it _will_ be a triangle. ==== To draw a specific triangle you need much more coding, involving sine rule an other trigonometry.

Related questions

Link list implimentation in c in an easier way please mail tha answer at tanwar prediffmail.com i m not able to understand the link list implimentation in c .from couple of days m working on it?

There is a crispness...


What is pascle triangle?

It is spelled Pascual's triangle, and it looks like this:11 11 2 11 3 3 11 4 6 4 11 5 10 10 5 1Basis of the Binomial Theorem as well as many other important mathematical functions.


What is the side c of the triangle?

Side c of a triangle is opposite angle C


Triangle ABC angle A is 60 what is angle C?

triangle ABC with rigth at C


What is pass in Python?

In Python,pass statement is a null operation, when you execute a pass statement it doesn’t show any error even if you didn’t write the implimentation of a function or class but you can use it for future implimentation.


How do you figure out angle in triangle C is 50?

It depends on the triangle in question. Angle C is not 50 in all cases!


What logo has a blue triangle with a yellow c and a mermaid?

The logo with a blue triangle and yellow c and mermaid is Cressi.


What is the third interior angle of triangle?

Let the angles be a, b and c There are 180 degrees in a triangle: 180-(a+b) = c 180-(a+c) = b 180-(b+c) = a


Can an equiangular triangle be scalene?

No. An equiangular triangle is always equilateral. This can be proven by the Law of Sines, which states that sin A / a = sin B / b = sin C / c, where A, B and C are angles of a triangle and a, b and c are the opposing sides of their corresponding angles. If A = B = C, then sin A = sin B = sin C. Therefore for the equation to work out, a = b = c. Therefore the eqiangular triangle is equilateral, and therefore not scalene, which requires that all sides of the triangle be of different lengths.


What is the pascle triangle?

Pascal's Triangle is an illustration of the coefficients of a binomial expansion. (There are also other patterns within the triangle, but it is primarily taught in relation to binomial expansion.) Each row begins and ends with the number one. The elements in each row are the sum of the two numbers above it in the previous row and continues indefinitely: 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1


Code for creating pascal's triangle in C programming language?

code for creating pascal's triangle in C programming language?


When is a triangle obtuse when lengths of sides are given?

Calculate the sum of the squares of the two shorter sides. If this is less than the square of the remaining, third, side then the triangle is obtuse.There are three possibilities - let the three sides of the triangle be A, B and C with C the longest side (that is C &ge; A and C &ge; B). Then, if:A2 + B2 > C2 the triangle is acuteA2 + B2 = C2 the triangle is right angledA2 + B2 < C2 the triangle is obtuse