answersLogoWhite

0


Best Answer

long factorial(int); int main() { int i, n, c; printf("Enter the number of rows you wish to see in pascal triangle\n"); scanf("%d",&n); for ( i = 0 ; i < n ; i++ ) { for ( c = 0 ; c <= ( n - i - 2 ) ; c++ ) printf(" "); for( c = 0 ; c <= i ; c++ ) printf("%ld ",factorial(i)/(factorial(c)*factorial(i-c))); printf("\n"); } return 0; } long factorial(int n) { int c; long result = 1; for( c = 1 ; c <= n ; c++ ) result = result*c; return ( result ); }

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the logic and theory for pascal triangle program in C?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the difference between a Theory and a Logic?

A theory is an explanation based on evidence and reasoning to describe a phenomenon, while logic is the principles of reasoning and inference used to make sense of information and draw conclusions. Theories are used to understand and explain the world, while logic is the systematic approach to ensuring the validity of arguments and reasoning.


What is logic and switching theory?

what is logic circuits and switching theory? how can it help us in our daily needs


What is logic circuit and switching theory?

what is logic circuits and switching theory? how can it help us in our daily needs


What has the author Thomas Downs written?

Thomas Downing has written: 'The catechisers holy encouragement to the profitable exercise of catechising in the Church of England' -- subject(s): Catechisms, English, Church of England, English Catechisms


Need of program Logic controllers?

Program logic controllers are used to control the operation of most systems.


A sentence for logic?

Logic is a theory of reasoning. An example sentence would be: According to his logic, it was alright to lie.


What is the logic of in triangle in C-programming?

Your question is ambiguous.


What has the author Arthur D Friedman written?

Arthur D. Friedman has written: 'Fundamentals of logic design and switching theory' -- subject(s): Logic circuits, Logic design, Switching theory


What is the theory in math that uses the words IF and THEN?

Logic.


What has the author Georg Kreisel written?

Georg Kreisel has written: 'Elements of mathematical logic (Model theory)' -- subject(s): Symbolic and mathematical Logic 'Elements of mathematical logic' -- subject(s): Symbolic and mathematical Logic 'Modelltheorie' -- subject(s): Model theory


What is the importance of set theory in math?

It develops the power to apply logic and logic in an integral part of mathematics.


What has the author John T Kearns written?

John T. Kearns has written: 'Reconceiving experience' -- subject(s): Experience, Knowledge, Theory of, Language and languages, Language and logic, Philosophy, Theory of Knowledge 'The principles of deductive logic' -- subject(s): Language and logic, Logic