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:
Data structure is a particular way of storing and organizing information in a computer so that it can be retrieved and used most productively.
ReplyDeleteDifferent kinds of data structures are meant for different kinds of applications, and some are highly specialized to specific tasks.
Data structures are important for the following reasons:
1. Data structures are used in almost every program or software system.
2. Specific data structures are essential ingredients of many efficient algorithms, and make possible the management of huge amounts of data, such as large integrated collection of databases.
3. Some programming languages emphasize data structures, rather than algorithms, as the key organizing factor in software design.