Graph Adjacency Matrix using 2D-Array

#include #include void  main( ) { int i, j ,siz; clrscr(); int G[100][100]; cout<<" Enter the size of sequre Metrix  \n";cout<<" Enter Rows siz :"; cin>>i; cout<<" \n Enter Colums siz : "   ; cin>>j; siz=j;  for(i=0 ; i < siz  ; i++) for(j=0 ; j< siz ; j++) { G[i][j]=0; } int a; cout<<" \n Enter the No of Edges: "; cin>>a; cout<<" \n Enter the exact location whereContinue reading “Graph Adjacency Matrix using 2D-Array”

Graph Adjacency List using Link list

#include#include struct Adj_list{ int dest;struct Adj_list *next; };struct Adjlist{struct Adj_list *head; }; class Graph{int v;int i;public:struct Adjlist *array; Graph(int v){this->v=v;array=new Adjlist[v];array[i].head=NULL;} Adj_list *newAdj_list(int dest){ Adj_list *newnode =new Adj_list;newnode->dest=dest;newnode->next=NULL;return newnode;} void addedge(int src,int dest){ Adj_list *newnode=newAdj_list(dest); newnode->next=array[src].head;array[src].head=newnode;newnode=newAdj_list(src);newnode->next=array[dest].head;array[dest].head=newnode;} void display(){ int i;for(i=0; i< v; i++){Adj_list *pcrawl=array[i].head;cout<<" \n Adjancy List of vertex  "<<i<<" head"; while(pcrawl){cout< “<dest;pcrawl=pcrawl->next; }cout<<endl;} }};voidContinue reading “Graph Adjacency List using Link list”

HAng MaN Game in C++

#include#include#include#include int a;void main(){ char ch[50],new1[50],word[50];cout<<"              ————————————————"<<endl;cout<<"                        Welcome To the HAng MaN Game "<<endl;cout<<"              ————————————————"<<endl<<endl;cout<<"                         |(((( Player OnE )))) |Continue reading “HAng MaN Game in C++”

Typedef in C++

The typedef-names are aliases for existing types, and are not declarations of new types. Typedef cannot be used to change the meaning of an existing type name (including a typedef-name). Once declared, a typedef-name may only be redeclared to refer to the same type again. Typedef names are only in effect in the scope whereContinue reading “Typedef in C++”

Heart ♥ in C++ .. ☻

#include#include#include void main(){clrscr();int num;cout<<"Please Enter Number : ";cin>>num;cout<<"\n\n";int g=num*2, x=num/2, v=0, m=num,n=0; for(int q=0;q<(num/2);q++){for(int u=0;u<x;u++)printf(” “);x–;cout<<char(3);for(int o=0;o<v;o++)printf(” “);v+=2;cout<<char(3);for(int l=0;l<m-1;l++)printf(” “);m-=2;cout<<char(3);for(int a=0;a<n;a++)printf(” “);n+=2;cout<<char(3);printf(“\n”); } for(int i=0;i<num;i++){int s,j;for(s=0;s<=i;s++){printf(” “);}cout<<char(3);for(j=0;j<g-1;j++){printf(” “);}g-=2;cout<<char(3);printf(“\n”);if(i==(num-1)){for(int f=0;f<(num+1);f++)printf(” “);cout<<char(3);}}getch();}

Turbo c++ for android { Complete guide of installation }

Hello guys, today in this post I will explain how to download and install turbo c++ in android. I am sure you are aware about for turbo c++. Well turbo c++ is one type of compiler which is specially designed for c/c++ .One can easily perform most of the c/c++ programs with help of turbo c++! We already provided turbo c++ for windowsContinue reading “Turbo c++ for android { Complete guide of installation }”

C Program to find the determinant of a Matrix

C Program to find the determinant of a Matrix  Size id Define By User#include#include int a[20][20],m;int determinant(int f[20][20],int a);int main(){  clrscr();  int i,j;  printf(“———————————————————————-\n”);  printf(“—————–CODE BY PROGRAMMING SEEKERZZ ————————\n”);  printf(“———————————————————————-\n”);  printf(“\n\nEnter order of matrix : “);  scanf(“%d”,&m);  printf(“\nEnter the elements of matrix\n”);  for(i=1;i<=m;i++)  {  for(j=1;j<=m;j++)  {  printf(“a[%d][%d] = “,i,j);  scanf(“%d”,&a[i][j]);  }  }  printf(“\n\n———- Matrix AContinue reading “C Program to find the determinant of a Matrix”

Sound Function in C or C++

In Both C and C++:————————————–#include#include void main(){   int a;   for ( a = 200 ; a <= 1000 ; a = a + 20 )   {      sound(a);      delay(25);   }   nosound();} ——————————————You can also do like that in C++ : #include#includevoid main(){cout<<"\a ——— \a ——– \a";getch();} ————————————–You can also do like that inContinue reading “Sound Function in C or C++”

Shell Sort code in C++

 Other Type Of Sorting : Click here :: most important :: #include#include void display(int *arr,int n){ cout<<endl; for(int i=0;i<=n;i++){ cout<<arr[i]<<"\t"; } cout<<endl;} void shellsort(int *arr,int n){ int gap,i,j,temp; for(gap=n/2;gap>0;gap/=2) { for(i=gap;i<=n;i++) { for(j=i-gap;j>=0 && arr[j]>arr[j+gap];j-=gap) { display(arr,n); temp=arr[j]; arr[j]=arr[j+gap]; arr[j+gap]=temp; } } }} void main(){int x[]={12,7,3,8,1,5,2};clrscr();display(x,6);shellsort(x,6);display(x,6);getch();}