Find Factorial using Recursion | C Program:
Write a C Program to Find Factorial User given using Recursion : About factorial: 5! = 5!x4!x3!x2!x1! = 120 Code: #include<stdio.h> void main() { int facto(int); int n,b; printf("Enter a range of factorial:\n"); scanf("%d",&n); b=facto(n); printf("\nThe factorial of %d is %d",n,b); } int facto(int n) { if(n==1) return n; else n=n*facto(n-1); return n; } Output:

An abstract data type is a type with associated operations, but whose representation is hidden. Common examples of abstract data types are the built-in primitive types in Haskell, Integer and Float. Haskell supports the definition of abstract data types via the module system. In many cases it is not necessary to completely hide the representation of data, so a normal data type definition is sufficient. In addition, parametrized types can be viewed as a kind of abstract type, because they leave some parts of the data type undefined, or abstract.
ReplyDelete