Popular posts from this blog
Print name in a pattern | name as abbreviation | C-Program
Write a c program to display the name in the following pattern. If the name is Rahul Das than it should display R.Das . Print abbreviation name: Tips:- Use character array to store stuff given by user. You need to use strlen function which is present in the string.h header file to find the length. Code:- #include<stdio.h> #include<string.h> //for strlen() funtion. void main() { char name[20]; int var=0,n=0; printf("Enter Your name :- "); gets(name); var=strlen(name); for(int i=0;i<=var;i++) { if(name[i]==' ') { n=i+1; } } printf("\nYour attribute is :- "); printf("%c.",name[0]); for(int j=n;j<var;j++) { printf("%c",name[j]); } printf("\n\n"); } Output:-
Print Fibonacci Series using Recursion | C program :
Write a C Program to Print Fibonacci series user given range using recursion , C program : Code: #include<conio.h> #include<stdio.h> void main() { int fibo(int); int n,i; printf("Enter the range of fibo:\n"); scanf("%d",&n); for(i=0;i<=n;i++) printf("%d\t",fibo(i)); getch(); } int fibo(int i) { if(i==0 || i==1) return 1; else return (fibo(i-1)+ fibo(i-2)); } 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