Coping Reverse Array into Another Array

This Program Take an array and copy that array into another array after reversing it  #includevoid main(){int A[]={0,1,2,3,4,5,6,7,8,9,10};int B[10];cout<<"\n Array A is: ";for(int i=0;i<=10;i++){cout<<A[i]<<"  ";}for(int i1=0,j=10;i1<=10;i1++,j–){B[j]=A[i1];}cout<<"\n Array B is: ";for(int i2=0;i2<=10;i2++){cout<<B[i2]<<"  ";}}

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 }”

Make all values of tree negative -ive

#include#includeclass Node{private: int data; Node* right; Node* left;public: Node(){  root=NULL;  right=left=NULL; }Node *root;  void insert(int data){   Node* newnode = new Node();   newnode->data = data;   if (root == NULL){   root=newnode;   return;  }   Node *p,*q;  p=q=root;  while (q!=NULL){   p=q;   if (newnode->data> q->data)    q = q->right;   else q = q->left;  }   if (newnode->data> p->data)   p->right = newnode;  elseContinue reading “Make all values of tree negative -ive”

Making all even values odd in a tree

#include#includeclass Node{private: int data; Node* right; Node* left;public: Node(){  root=NULL;  right=left=NULL; }Node *root;  void insert(int data){   Node* newnode = new Node();   newnode->data = data;   if (root == NULL){   root=newnode;   return;  }   Node *p,*q;  p=q=root;  while (q!=NULL){   p=q;   if (newnode->data> q->data)    q = q->right;   else q = q->left;  }   if (newnode->data> p->data)   p->right = newnode;  elseContinue reading “Making all even values odd in a tree”

Make all Odd values Even in a tree

#include#includeclass Node{private: int data; Node* right; Node* left;public: Node(){  root=NULL;  right=left=NULL; }Node *root;  void insert(int data){   Node* newnode = new Node();   newnode->data = data;   if (root == NULL){   root=newnode;   return;  }   Node *p,*q;  p=q=root;  while (q!=NULL){   p=q;   if (newnode->data> q->data)    q = q->right;   else q = q->left;  }   if (newnode->data> p->data)   p->right = newnode;  elseContinue reading “Make all Odd values Even in a tree”

Display only Odd values from tree

#include#includeclass Node{private: int data; Node* right; Node* left;public: Node(){  root=NULL;  right=left=NULL; }Node *root;  void insert(int data){   Node* newnode = new Node();   newnode->data = data;   if (root == NULL){   root=newnode;   return;  }   Node *p,*q;  p=q=root;  while (q!=NULL){   p=q;   if (newnode->data> q->data)    q = q->right;   else q = q->left;  }   if (newnode->data> p->data)   p->right = newnode;  elseContinue reading “Display only Odd values from tree”

Display only even Values from tree

#include#includeclass Node{private: int data; Node* right; Node* left;public: Node(){  root=NULL;  right=left=NULL; }Node *root;  void insert(int data){   Node* newnode = new Node();   newnode->data = data;   if (root == NULL){   root=newnode;   return;  }   Node *p,*q;  p=q=root;  while (q!=NULL){   p=q;   if (newnode->data> q->data)    q = q->right;   else q = q->left;  }   if (newnode->data> p->data)   p->right = newnode;  else p->left =Continue reading “Display only even Values from tree”

Write a Function to display only leaf nodes

#include#includeclass Node{private: int data; Node* right; Node* left;public: Node(){  root=NULL;  right=left=NULL; }Node *root;  void insert(int data){   Node* newnode = new Node();   newnode->data = data;   if (root == NULL){   root=newnode;   return;  }   Node *p,*q;  p=q=root;  while (q!=NULL){   p=q;   if (newnode->data> q->data)    q = q->right;   else q = q->left;  }   if (newnode->data> p->data)   p->right = newnode;  elseContinue reading “Write a Function to display only leaf nodes”

Insert 100 in all Leaf nodes and 10 in all non leaf nodes using BST

Insert 100 in all Leaf nodes and 10 in all non leaf nodes using BST in C++ #include#includeclass Node{private: int data; Node* right,*q,*p; Node* left;public: Node(){ root=NULL; right=left=NULL; }Node *root; void insert(int data){ Node* newnode = new Node(); newnode->data = data; if (root == NULL){ root=newnode; return; } Node *p,*q; p=q=root; while (q!=NULL){ p=q; ifContinue reading “Insert 100 in all Leaf nodes and 10 in all non leaf nodes using BST”