# Chapter 3

Example 1 :
#include<iostream.h>
void main( )
{
int a;
a = 50;
a = 100 ;
cout<<"\n a = "<<a ;
}

Example 2: Program to illustrates processing of an Array
#include<iostream.h>
#include<conio.h>
void main( )
{
double A[3];
// Array Declaration
// Stores Data in Array
clrscr();
A[2] = 22.22;
A[0] = 11.11;
A[1] = 33.33;
//Read Data from an Array
cout << " A[0] = "<<A[0]<<endl;
cout << " A[1] = "<<A[1]<<endl;
cout << " A[2] = "<<A[2]<<endl;
getch( );
}

Example 3: Program to illustrates processing of an Array
#include<iostream.h>
#include<conio.h>
void main( )
{
const int SIZE = 5; //defines the size N for 5 elements
int A[SIZE] ;
// declares the array's elements as type integer
cout<<"\n Enter "<<SIZE<<" Numbers : \t" ;
for ( int i = 0; i < SIZE; i++)

cin>>A[i];
cout<<"\n In Reverse Order : ";
for( i = SIZE - 1; i >= 0 ; i--)
cout<<"\t"<<A[i];
getch( );
}

Example 4: Program to illustrates Array Index out of Bounds
#include<iostream.h>
#include<conio.h>
void main( )
{
const int SIZE = 4;
float A[SIZE]= { 22.22, 44.40, 12.13, 14.15 };
clrscr();
for(int i = 0; i<7;i++)
//ERROR : index is out of bounds !
cout<<"\t A["<<i<<" ] = " << A[i]<<endl;
getch();
}

Example 5: Program to illustrates unhandled Exceptions
#include<iostream.h>
#include<conio.h>
void main( )
{
float A[4]= { 22.22, 44.40, 12.13, 14.15 };
float x = 12.12;
cout<<" x = "<<x << endl;
A[5555] = 18.77;
//ERROR : index is out of bounds.
cout<<" x = "<<x << endl;
}

Example 6: Program to illustrate Passing Array Elements to a Function (Call by
Value)
#include<iostream.h>

#include<conio.h>
void show( int ) ;
void main( )
{
int number[ ]= { 11, 22, 33, 44, 55 } ;
for( int i = 0; i <= 4; i++)
show(number[i]); //passing element of an array to the function
getch( );
}
void show(int x)
{
cout<<"\t"<<x;
}

Example 7: Program to illustrates Passing Array Elements to a Function (Call by
Reference)
#include<iostream.h>
#include<conio.h>
void display( int* ) ;
void main( )
{
int number[ ]= { 11, 22, 33, 44, 55 } ;
for( int i = 0; i <= 4; i++)
//passing address of an element to the function
display(&number[i]);
getch( );
}
void display (int *x)
{
cout<<"\t"<<*x;
}

Example 8 : Program to illustrates Pointers & Arrays
#include<iostream.h>
#include<conio.h>
void main( )
{
int A [ ] = { 11, 33, 55, 77, 99 } ;
for ( int i = 0; i <= 4; i++)

{
cout<<"\n Element "<< i <<"\t" ;
cout<<" Number "<< A[i] <<"\t" ;
cout<<" Address = "<<&A[i];
}
getch( );
}

Example 9 : Program to illustrates Accessing Array elements using pointers
#include<iostream.h>
#include<conio.h>
void main( )
{
int A [ ] = { 11, 33, 55, 77, 99 } ;
int *j ;
j = &A[0] ;
//assign address of 0th element
for ( int i = 0; i <= 4; i++)
{
cout<<"\n Address = "<< j<< "\t" ;
cout<<" Element = "<< *j ;
j ++ ;
// increment pointer to point next location
}
getch( );
}

Example 10 : Program to illustrates Passing an entire Array to a Function
#include<iostream.h>
#include<conio.h>
void display( int*, int ) ;
void main( )
{
int number [ ] = { 11, 22, 33, 44, 55 } ;
display (&number[0], 5);
}
void display (int *j , int n)
{
for (int i = 0; i <= n-1 ; i++)
{
cout<<"\n Element : "<< *j ;

j ++;

//increment pointer to point to next location

}
}

Example 11 : Program to print Memory Location of an Array
#include<iostream.h>
#include<conio.h>
void main( )
{
int number [ ] = { 11, 22, 33, 44, 55 } ;
cout<<" Number = "<< number ;
getch( );
}

Example 12 : Program to illustrates Two-dimensional Array
#include <iostream.h>
#include <conio.h>
void main( )
{
int emp[4][2] ;
int i ;
for ( i = 0; i <=3 ; i++)
{
cout<<"\n Enter Employee No. and Salary : ";
cin>>emp[i][0]>>emp[i][1];
}
cout<<"\n Emplyoee Number \t Salary ";
for ( i = 0; i <=3 ; i++)
cout<<"\n"<<emp[i][0]<<"\t\t"<<emp[i][1];
getch( );
}

Example 13 : Program to illustrates, Initializing a Two-Dimensional Array
#include <iostream.h>
#include <conio.h>

void main ()
{
int i , j ;
int digits[4][3] = { {0,1,2},{3,4,5},{6,7,8},{9,10,11} } ;
cout<<"\n The digits are :\n" ;
for (i=0 ; i<4 ; i++)
{
for (j=0 ; j<3 ; j++)
cout<<" \n "<<digits[i][j] ;
}
getch () ;
}

Example 14 : Program to illustrates, Initializing a Two-Dimensional Array
#include <iostream.h>
#include <conio.h>
void main ( )
{
int i , j ;
char letters[6][1] = { {'M'},{'i'},{'c'},{'k'},{'e'},{'y'} } ;
cout<<"\n The letters are :\n" ;
for (i = 0, j = 0 ; i < 6 ; i++)
cout<<letters[i][j] ;
getch ( ) ;
}

Example 15 : Program that adds up the individual elements of 2 D Array
#include <iostream.h>
#include <conio.h>
void main ( )
{
int i , j , sum ;
int elements[3][7] = { {0,2,4,6,8,10,12},
{14,16,18,20,22,24,26},
{28,30,32,34,36,38,40} } ;
for ( i = 0,sum = 0 ; i < 3 ; i++)
{
for (j=0 ; j<7 ; j++)

sum = sum + elements[i][j] ;
}
cout <<"\n The result of addition = "<< sum ;
getch ( ) ;
}

Example 16 : Program that display average of marks for each subject
#include <iostream.h>
#include <conio.h>
void main ( )
{
int i , j ;
int marks[3][5] ={ {65,68,75,59,77},
{62,85,57,66,80},
{71,77,66,63,86} } ;
float avg ;
cout<<" \n\t\t ";
for (i = 0 ; i < 5 ; i++)
cout<<"subj"<<i+1<<"\t";
cout<<"\n" ;
for (i=0 ; i<3 ; i++)
{
cout<<" student"<<i+1<<"\t";
for(j=0 ; j<5 ; j++)
cout<<marks[i][j]<<"\t";
cout<<" \n ";
}
cout<< "\n\nThe Average of each subject is : \n" ;
for (j=0 ; j<5 ; j++)
{
cout<<"Subject"<<j+1<<" : " ;
for (i=0,avg=0 ; i<3 ; i++)
avg = avg + float(marks[i][j]) ;
avg = avg / 3 ;
cout.precision(2);
cout<<avg<<"\n";
}
getch () ;
}

Example 17 : Program for Matrix Addition
#include <iostream.h>
#include <conio.h>
void main ( )
{
int i , j , add[3][3] ;
int set1[3][3] = { {1,3,5},{7,9,11},{13,15,17} } ;
int set2[3][3] = { {2,4,6},{8,10,12},{14,16,18} } ;
cout<<"The first 3X3 matrix is :\n";
for (i=0 ; i<3 ; i++)
{
for (j=0 ; j<3 ; j++)
cout<<set1[i][j]<<"\t";
cout<<"\n" ;
}
cout<<"\n" ;
cout<<"The second 3X3 matrix is :\n";
for (i=0 ; i<3 ; i++)
{
for (j=0 ; j<3 ; j++)
cout<<set2[i][j]<<"\t";
cout<<"\n" ;
}
cout<<"\n" ;
for (i=0 ; i<3 ; i++)
{
for (j=0 ; j<3 ; j++)
add[i][j] = set1[i][j] + set2[i][j] ;
}
cout<<"The resultant addition 3X3 matrix is :\n" ;
for (i=0 ; i<3 ; i++)
{
for (j=0 ; j<3 ; j++)
cout<<add[i][j]<<"\t";
cout<<"\n" ;
}
cout<<"\n" ;
getch ( ) ;
}

Example 18 : Program for Matrix Multiplication
#include <iostream.h>
#include <conio.h>
void main ()
{
int i , j , k ;
int set1[3][2] , set2[2][4] , multi[3][4] ;
cout<<" Enter values of first 3X2 matrix :\n" ;
for (i=0 ; i<3 ; i++)
{
for (j=0 ; j<2 ; j++)
cin >> set1[i][j] ;
}
cout<<" Enter values of second 2X4 matrix :\n" ;
for (i=0 ; i<2 ; i++)
{
for (j=0 ; j<4 ; j++)
cin >> set2[i][j] ;
}
cout<<" The first 3X2 matrix is :\n" ;
for (i=0 ; i<3 ; i++)
{
for (j=0 ; j<2 ; j++)
cout <<set1[i][j]<<"\t" ;
cout <<"\n" ;
}
cout <<"\n" ;
cout<<"The second 2X4 matrix is :\n" ;
for (i=0 ; i<2 ; i++)
{
for (j=0 ; j<4 ; j++)
cout <<set2[i][j]<<"\t" ;
cout <<"\n" ;
}
cout <<"\n" ;
for (i=0 ; i<3 ; i++)
for (k=0 ; k<4 ; k++)
multi[i][k] = 0;
for (i=0 ; i<3 ; i++)
{
for (j=0 ; j<2 ; j++)
{
for (k=0 ; k<4 ; k++)
multi[i][k] += set1[i][j]*set2[j][k] ;
}

}
cout<<"The resulting 3X4 matrix is :\n" ;
for (i=0 ; i<3 ; i++)
{
for (j=0 ; j<4 ; j++)
cout<<multi[i][j]<<"\t";
cout <<"\n" ;
}
getch ( ) ;
}

Example 19 : Program to illustrates Processing a 3-D Arrays
#include <iostream.h>
#include <conio.h>
int numzeros(int a[ ][4][3], int n1, int n2, int n3);
void main( )
{
int a[2][4][3]={ { {5,0,2}, {0,0,9}, {4,1,0}, {7,7,7}},
{ {3,0,0}, {8,5,0}, {0,0,0}, {2,0,9}}
};
cout<<"This Array has "<<numzeros(a,2,4,3)<<" zeros. \n";
getch( );
}
int numzeros (int a[ ][4][3], int n1, int n2, int n3)
{
int count = 0;
for (int i = 0; i < n1; i++)
for (int j= 0; j < n2; j++)
for (int k = 0; k < n3; k++)
if (a[i][j][k] == 0) ++count;
return count;
}

Example 20 : Program to illustrates Automatic Storage Classes
#include<iostream.h>
void main( )
{
auto int i = 1 ;
{

auto int i= 2 ;
{
auto int i = 3;
cout<<"\n"<<i ;
}
cout<<"\n "<<i ;
}
cout<<"\n"<<i ;
}

Example 21 : Program to illustrates Register Storage Classes
#include <iostream.h>
#include <conio.h>
void main( )
{
register int x;
for( x =1 ; x <= 10; x++)
cout<<"\n "<<x;
getch( );
}

Example 22 : Program to illustrate Call by Reference
#include <iostream.h>
#include <conio.h>
void swap2 (int*i, int*j);
// Function prototype
void main( )
{
int a = 5, b =25 ;
swap2 (&a, &b);
// Call by passing addresses of variables
cout<<"\n a = "<<a<<"\t b = "<<b;
getch( );
}
void swap2 (int *x, int *y)
// Function definition
{
int temp;
// To interchange 2 numbers
temp = *x;
*x = *y;
*y = temp ;
}

Example 23 : Program to illustrate Call by Value
#include <iostream.h>
#include <conio.h>
void swap1 (int i, int j);
// Function prototype
void main( )
{
int a = 5, b =25 ;
swap1 (a, b);
// Call by Value
cout<<"\n a = "<<a<<"\t b = "<<b;
getch( );
}
void swap1 (int x, int y)
// Function definition
{
int temp;
// To interchange 2 numbers
temp = x;
x = y;
y = temp ;
cout<<"\n x = "<<x<<"\t y= "<<y;
}
Example 24 : Program to illustrate Default Arguments
#include <iostream.h>
#include <conio.h>
double poly (double, double, double = 0, double = 0, double = 0 );
void main( )
{
double x = 2.0003 ;
cout<<" poly(x,7) = " << poly(x,7) << endl;
cout<<" poly(x,7,6) = " << poly(x,7,6) << endl;
cout<<" poly(x,7,6,5) = " << poly(x,7,6,5) << endl;
cout<<" poly(x,7,6,5,4) = " << poly(x,7,6,5,4) << endl;
}
double poly (double x, double a0, double a1, double a2, double a3 )
{
return a0 +(a1 + (a2 + a3 *x)*x)*x;
}

Example 25 : Program to find Recursive function power(x,y) to find x^y
# include <iostream.h>
# include<conio.h>
int power ( int x, int y);
void main( )
{
int x, y ;
cout<< "\n Enter value of x & y : ";
cin>>x>>y;
cout<<"\n"<<x<<" ^ "<<y<<" = "<< power(x,y);
}
int power (int x, int y)
// Recursive power function
{
if (y ==1)
return x;
else
return(x * power(x,y-1));
}

Example 26 : Program to compute GCD &LCM
# include <iostream.h>
# include<conio.h>
void swap(int &, int &);
long LCM (long, long) ;
long GCD(long, long);
void main( )
{
int m,n;
cout<<"\n Enter two positive integers : ";
cin >> m >> n ;
cout<<"GCD ( " << m <<", "<<n<<" ) = " <<GCD(m,n)<<endl;
cout<<"LCM ( " << m <<", "<<n<<" ) = " <<LCM(m,n)<<endl;
}
void swap(int & x, int & y)
{
//exchange the values of x and y
int temp = x;
x = y;
y = temp;
}
long GCD(long m, long n)

{
if(m<n)
swap(m,n);
while (n > 0)
{
int r = m % n;
m = n;
n=r;
}
return m;
}
long LCM(long m, long n)
{
return m * n/GCD(m, n);
}

Example 27 : Program to perform sorting and to display largest and second largest
elements in the list
# include <iostream.h>
# include<conio.h>
# define TRUE 1
#define FALSE 0
#define MAX 20
void bubble(int x[ ], int n)
{
int hold, j, pass;
int switched = TRUE;
for(pass=0; pass<n-1&&switched==TRUE; pass++)
{ // Outer loop controls the number of passes
switched = FALSE;
// Initially no interchange have been made on this pass
for(j=0; j<n-pass-1; j++)
// Inner loop governs each individual pass
if (x[j] > x[j+1])
{
//Interchange elements if they are out of order
switched = TRUE;
hold=x[j];
x[j] = x[j+1];
x[j+1] = hold;
}
//end if
}
// end for
}
// end bubble function

void main( )
{
int i, n;
int x[MAX];
cout<<"\n Enter numbers of elements :";
cin>>n;
cout<<"\n Enter Numbers in any order : \n";
for(i=0; i<n; i++)
{
cout<<"\n Element["<<i<<"] = ";
cin>>x[i];
}
bubble(x,n);
cout<<"\n \nSorted Elements are : \n";
for(i=0; i<n; i++)
cout<<"\n Element["<<i<<"] = "<<x[i];
// Displays the largest and 2nd largest element from sorted list
cout<<"\n\n Largest Element is : "<<x[n-1];
cout<<"\n Second largest Element is : "<<x[n-2];
getch( );
}

Example 28 :
# include <iostream.h>
#include<math.h>
int sq_root (int);
double sq_root (double);
long int sq_root (long int);
void main (void)
{
int a = 25;
long int b = 225;
double c=225;
cout << "Square root of int value=" << sq_root (a);
cout << "Square root of double value =" <<sq_root (c);
cout << "Square root of long int value =" <<sq_root (b);
}
int sq_root (int a)
{
return (sqrt (a));
}
double sq_root (double c)
{

double x;
x = sqrt(c);
return (x);
}
long int sq_root(long int x)
{
long int z;
z = sqrt (x);
return (z);
}

Example 29 :
#include<iostream.h>
#include<conio.h>
#include<math.h>
double power(double m, int n = 2);
void main()
{
int m,n;
cout << "\n Enter value of m & n";
cin >> m >> n;
cout << " power("<< m <<", "<< n <<") = "
<< power (m, n);
cout << "power(" << m <<", 2)" << power (m);
getch( );
}
double power (double m, int n)
{
return(pow(m, n));
}

Example 30 :
#include<iostream.h>
#include<conio.h>
#include<string.h>
float ADD (float, float);
int ADD (int, int);
char * ADD (char *, char *);
char S1 [50] , S2 [50], S3 [100];
void main ( )

{

int n = ADD (4, 6);
float d = ADD (4.7, 8.4)
;
cout << " Add (4, 6) = " << n ;
cout << " Add (4.7, 8.4) = " << d << " \n" ;
strcpy (S1, " Object oriented ");
strcpy (S2, " Database model ");
strcpy (S3, ADD (S1, S2));
cout << S1 << " + " << S2 << " = " << S3 ;
getch( ) ;

}
float ADD (float a, float b)
{
return (a + b);
}
int ADD (int a, int b)
{
return (a + b);
}
char * ADD (char* S1, char* S2)
{
strcat (S1, S2) ;
return S1;
}

Example 31 :
//main file funcall.cpp
#include<conio.h>
#include<iostream.h>
#include "log_x10.cpp"
#include"expo.cpp"
void main()
{
logx10();
expo();
}
//logx_10.cpp
# include<math.h>
# include<iostream.h>
void logx_10()
{

int n=0;
cout<<"Enter number;";
cin>>n;
cout<<"The log value is "<<log(n);
}
//expo.cpp
# include<math.h>
# include<iostream.h>
void expo()
{
int n=0;
cout<<"Enter number:";
cin>>n;
cout<<"\n Exponential value="<<exp(n);
}

Example 32 :
# include<iostream.h>
# include<conio.h>
void main()
{
int j=0;
clrscr();
void extend(double[], double[],double[]);
double qty[10]={3,9.7,6.40,4.5,5.6,6.2,7,2.8,15.0,18.0};
double price[10]={10.20,11.30,13.14,16.9,18.1,2.71,7.55,15.12,9.45,17.0};
double amount[10]={1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0};
double tamount[10];
extend(qty,price,amount);
for (j = 0; j <= 9; j++)
{
tamount[j] = amount[j];
}
for(j=0;j<=9;j++)
{
cout<<tamount[j]<<"\n";
}
getch();
}
void extend(double q[], double p[], double amount[])
{
int i=0;
for(i=0;i<=9;i++)

{
amount[i]=q[i]*p[i];
}
}

Example 33 :
# include<iostream.h>
# include<conio.h>
void main()
{
int no=0,pos=0;
void delchar(char[],int,int);
char string[10];
cout<<"Enter string";
cin>>string;
cout<<"Enter no. of characters to delete";
cin>>no;
cout<<"Enter starting position";
cin>>pos;
pos = pos - 1;
delchar(string,no,pos);
getch();
}
void delchar(char s[], int n, int p)
{
int i, c;
for(i=p,c=0;c<n;i++)
{
s[i]=' ' ; c++;
}
while (s[i]!='###BOT_TEXT###')
{
s[p] = s[i];
p++; i++;
}
s[p]='###BOT_TEXT###';
cout<<"\nNow string is :" << s;
}

Example 34 :
#include<iostream.h>
#include<conio.h>
void main ( )
{
char a [20], ch ;
int i , count ;
cout<< "\n Enter a String : " ;
cin>>a;
cout<<"\nEnter a character to check its frequency in given string :";
cin>>ch;
i=0;
while (a[i]!='###BOT_TEXT###')
{
if ( ch == a [ i ] )
count = count +1 ;
i=i+1;
}
cout<< "\nFrequency of given letter is "<<count ;
getch ( ) ;
}

Example 35 : Program to find s2 in s1 where s1 is the main string and s2 is substring
#include<iostream.h>
#include<string.h>
#include<conio.h>
#include<stdio.h>
void main ( )
{
char s [ 20 ], s1 [ 20 ], s2 [ 20 ], *p = " " ;
int i ;
clrscr();
cout<< "\n Input string :" ;
gets ( s );
cout<< "\n Enter second string " ;
gets ( s2 );
strcpy ( s1, s );
p = strtok ( s2, " " ) ;
for ( i = 0; p ; i ++ )

{
if ( strcmp ( p, s2 ) == 0 )
cout << "\n string found " ;
p = strtok ( NULL, " " ) ;
}
getch ( ) ;
}

Example 36 :
#include<iostream.h>
#include<conio.h>
#include<string.h>
void main ( )
{
char s [ 15 ] ;
int i , p ;
cout<< "\nEnter any string : ";
cin>>s;
p = strlen ( s ) ;
for ( i = 0; i < p ; i ++ )
cout<< "\nElement at position "<<i+1<<" is"<< s[i] ;
getch ( ) ;
}

Example 37 :
#include<iostream.h>
#include<conio.h>
void main()
{
int x[100],i=1,avg=0,max=0,min=0,sum=0;
cout<<"\nEnter the values in the array X";
for(i=0; i<100; i++)
cin>>x[i];
for(i=0;i<100;i++)
cout << "Element ["<< i + 1 <<" ] = " << x[i];
for(i=0;i<100;i++)
sum=sum+x[i];
cout<<"\n Sum of array elements is : "<<sum;

avg=sum/100;
cout<<"\n Average of array elements is : "<<avg;
for(i=0; i<100; i++)
{
if (x[i]>avg) max++;
else min++;
}
cout<<"\n Total "<<max<<" numbers are present in array X ";
cout<<"\nwhich are greater than average";
cout<<"\nTotal "<<min<<" numbers are present in array X ";
cout<<"\nwhich are less than average";
getch( );
}

Example 38 :
#include<iostream.h>
#include<math.h>
#define MAX 5
#include<conio.h>
void main( )
{
float mean=0,variance=0;
int i,x[MAX];
clrscr();
for(i=0;i<MAX;i++)
{
cout<<"\n Enter array elements: ";
cin>>x[i] ;
mean = mean+x[i];
}
mean = mean/MAX;
cout<<"\n Mean : "<<mean ;
for(i=0;i<MAX;i++)
variance = variance + (x[i]-mean)*(x[i]-mean);
variance = variance/MAX;
cout<<"\nVariance : "<<variance ;
cout<<"\n Standard Deviation : "<<sqrt(variance);
}

Example 39 :
#include <iostream.h>
#include <math.h>
#include<conio.h>
int ack (int m, int n);
void main ( )
{
int x, y, z;
cout<< "\n Enter values of x and y" ;
cin>>x>>y;
z = ack (x, y);
cout<<z;
getch ( );
}
int ack ( int m, int n )
{
int p;
if ( m == 0 )
return ( n + 1 );
else if ( n == 0 && m > 0 )
p = ack ( m - 1, 1 );
else if ( m >= 0 && n >= 0 )
p = ack ( m - 1, ack ( m, n - 1 ) );
return (p);
}
Example 40 : Program to compute combination Function
# include <iostream.h>
# include<conio.h>
long comb( int n, int r);
void main( )
{
for ( int i = -1; i < 6; i++)
{
for( int j = -1; j <= i+1; j++)
cout<<" "<<comb(i,j);
cout<<endl;
}
}
long fact( int n);
long comb( int n, int r)
{
if ( n < 0 || r < 0 || r > n)

return 0;
return fact(n) / ( fact (r) * fact (n -r));
}
long fact (int n)
{
if (n < 2) return 1;
long f = 1;
for (int i = 2; i <= n; i++)
f *= i;
return f;
}

Example 41 :
#include<iostream.h>
#include<conio.h>
#include<string.h>
struct sirname
{
char name[30];
}sn[10];
void main()
{
int i,j;
char temp[30];
clrscr();
for(i=0;i<5;i++)
{
cout<<"\nEnter "<<i+1<<" Sirname :";
cin>>sn[i].name;
}
for(i=0;i<5;i++)
{
for(j=i;j<5;j++)
{
if(strcmp(sn[i].name,sn[j].name)>0)
{
strcpy(temp,sn[i].name);
strcpy(sn[i].name,sn[j].name);
strcpy(sn[j].name,temp);
}
}

}
for(i=0;i<5;i++)
cout<<"\n"<<sn[i].name;
getch();
}

Example 42 :
#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
#define MAX 5
int main()
{
int a[MAX][MAX],i,j;
cout<<"\nEnter the matrix row wise :";
for(i=0;i<MAX;i++)
{
for(j=0;j<MAX;j++)
{
cout<<"\n Enter a["<<i<<"]["<<j<<"]element : ";
cin>>a[i][j];
}
}
for(i=0;i<MAX;i++)
{
for(j=0;j<MAX;j++)
{
if(i!=j && a[i][j]!=0)
{
cout<<"\nMatrix is not diagonal matrix";
getch(); exit(0);
}
}
}
cout<<"\nMatrix is diagonal matrix";
getch();
return(0);
}

Example 43 : Program to illustrates External Storage Classes
#include<iostream.h>
int i ;
//External variable
void decre( );
void incre( ) ;
void main( )
{
cout << "\n i = "<<i ;
incre( );
incre( );
decre( );
decre( );
}
void incre( )
{
i = i + 1;
cout << "\n On incrementing i = " << i ;
}
void decre( )
{
i = i - 1;
cout << "\n On decrementing i = " << i ;
}

Example 44 : Program to illustrates Function Overloading
#include <iostream.h>
// Function prototypes
int add (int, int);
float add (float, float, float);
void main( )
{
int a=5, b=10;
float c=4.5, d=2.5, e=8.7;
cout << " First addition result = " << add (a,b);
cout << "\n Second addition result = " << add (c,d,e);
}

int add (int p, int q)
{
return (p+q);
}
float add (float p, float q, float r)
{
return (p+q+r);
}

Example 45 : Program to find area of rectangle and circle using Function
Overloading
#include <iostream.h>
float area (float, float);
// prototypes
float area (float);
void main( )
{
cout << "Area of a rectangle = " << area(1.5, 3.6);
cout << "\nArea of a circle = " << area(2.5) << "\n";
}
float area(float length, float width) // Definition - 1
{
return(length * width);
}
float area(float radius)
// Definition - 2
{
return(3.142 * radius * radius);
}

Example 46 : Program to find volume of cube, cylinder and rectangle
#include <iostream.h>
#include <conio.h>
//Declaration (Prototypes)
int volume (int);
double volume (double, int) ;
long volume (long, int, int) ;
int main( )

{
cout << volume (10) <<endl;
cout <<volume (2.5, 8) <<endl;
cout <<volume (100L, 75, 15) <<endl;
getch( );
return 0;
}
int volume (int x)
// volume of cube
{
return (x*x*x);
}
double volume(double r, int h)
// volume of cylinder
{
return (3.14519*r*r*h) ;
}
long volume(long l, int b, int h)
// volume of rectangular
{
return (l*b*h);
}

Example 47 : Program to illustrate Function prototype
#include <iostream.h>
void find_minimum ( int i, int j, int k ) ;
// Function prototype
void main ( )
{
int a, b, c ;
cout << "\n Input three numbers : " ;
cin >>a ;
cin >>b ;
cin >>c ;
find_minimum ( a, b, c ) ;
// Function call
}
void find_minimum ( int i, int j, int k )
// Function definition
{
int min ;
min = i ;
if ( min > j )
min = j ;
if ( min > k )
min = k ;
cout<< "\n The minimum number is :" << min ;
}

Example 48 : Program to illustrate sending & receiving values between Function
#include<iostream.h>
#include<conio.h>
int calculate_sum(int x, int y)
{
int z ;
z=x+y;
return (z) ;
}
void main( )
{
int a, b, sum ;
cout <<"\n Enter Two Number : ";
cin >> a;
cin >> b;
sum = calculate_sum(a,b);
cout<<"\n Sum is : "<<sum;
getch();
}

Example 49 :
#include<iostream.h>
void function( int b)
{
b = 100 ;
cout<<"\n value :" <<b;
}
void main( )
{
int a = 50;
function(a);
cout<<"\n=value : "<<a;
}

Example 50 : Program to illustrate void main( )
#include<iostream.h>
void fun ( )
{
cout<<"\n Welcome to the world of C++ ……";
}
void main( )
{
cout<<"\n Welcome to the world of Programming…..";
fun ( );
}
Example 51 : Program to illustrate Function
#include<iostream.h>
#include<conio.h>
void function1 ( )
{
cout<<"\n I am in function1 ……";
}
void function2 ( )
{
cout<<"\n I am in function2 ……";
}
void function3 ( )
{
cout<<"\n I am in function3 ……";
}
void main( )
{
cout<<"\n I am in main ……";
function1 ( ) ;
function2 ( ) ;
function3 ( ) ;
getch ( );
}

Example 52 : Program to illustrate Function

#include<iostream.h>
void fun ( )
{
cout<<"\n Welcome to the world of C++ ";
}
int main( )
{
cout<<"\n Welcome to the world of Programming..";
fun ( );
return 0;
}

Example 53 : Program to illustrate Global Variables
#include<iostream.h>
#include<conio.h>
int a, b, c ;
// Global Variable Declaration
void find_minimum ()
{
int min ;
min = a ;
if ( min > b )
min = b ;
if ( min > c )
min = c ;
cout << "\nThe minimum number is : "<<min ;
}
void main ()
{
cout<< "\n Input three numbers : " ;
cin>>a;
cin>>b;
cin>>c;
find_minimum () ;
getch();
}

Example 54 : Program to illustrates Inline Functions
#include <iostream.h>
#include <conio.h>

inline int square (int a)

// inline function definition

{
return (a*a);
}
void main(void)
{
cout << "Square(10) = " << square(10);
cout << "\n Square(10+10) = " << square(10+10);
getch( );
}

Example 55 : Program to illustrate isalnum( ) function
#include <iostream.h>
#include <ctype.h>
#include <conio.h>

//defines the cout, cin object
// defines the isalnum( ) function

void main()
{
char c,ans;
int a;
do
{
cout<<"\nEnter a character -";
cin >> c;
if(isalnum(c)>0)
cout<<"\nThe character is an alphanumeric character.";
else
cout<<"The character is not an alphanumeric character.";
cout<<"\nDo you want to continue ? (y or n) : \n " ;
cin>>ans;
}
while((ans=='y')||(ans=='Y'));
}

Example 56 : Program to illustrate isalpha( ) function
#include <iostream.h>
#include <ctype.h>

//defines the cout, cin object
// defines the isalpha( ) function

#include <conio.h>
void main ( )
{
char c , ans ;
int a ;
do
{
cout<<"\n Enter a character -" ;
cin >>c ;
if (isalpha (c) > 0)
cout<<"\n The character is an alphabet." ;
else
cout<<"\n The character is not an alphabet." ;
cout<<"\n Do you want to continue ? (y or n) : ";
cin >> ans;
}
while ( (ans == 'y') || (ans == 'Y') ) ;
getch();
}

Example 57 : Program to illustrate iscntrl ( ) function
#include <iostream.h>
#include <ctype.h>
#include <conio.h>

//defines the cout, cin object
// defines the iscntrl( ) function

void main ()
{
char c , ans ;
int a ;
do
{
cout<<"\n Enter a character -" ;
cin >>c ;
if (iscntrl (c) > 0)
cout<<"\n The character is a control character ." ;
else
cout<<"\n The character is not a control character." ;
cout<<"\n Do you want to continue ? (y or n) : ";
cin >> ans;
}
while ( (ans == 'y') || (ans == 'Y') ) ;

getch();
}

Example 58 : Program to illustrate isdigit( ) function
#include <iostream.h>
#include <ctype.h>
#include <conio.h>
void main ()
{
char c , ans ;
int a ;

// defines the isdigit( ) function

do
{
cout<<"\n Enter a character -" ;
cin >>c ;
if (isdigit (c) > 0)
cout<<"\n The character is digit ." ;
else
cout<<"\n The character is not a digit ." ;
cout<<"\n Do you want to continue ? (y or n) : ";
cin >> ans;
}
while ( (ans == 'y') || (ans == 'Y') ) ;
getch();
}

Example 59 : Program to illustrate islower( ) function
#include <iostream.h>
#include <conio.h>
#include <ctype.h>

// header file for islower( )

void main ( )
{
char c , ans ;
int a ;
do
{
cout<<"\n Enter a character -" ;

cin >>c ;
if (islower (c) > 0)
cout<<"\n The character is a lower case character ." ;
else
cout<<"\n The character is not a lower case character." ;
cout<<"\n Do you want to continue ? (y or n) : ";
cin >> ans;
}
while ( (ans == 'y') || (ans == 'Y') ) ;
getch();
}
Example 60 : Program to illustrate toupper( ) function
#include <iostream.h>
#include <conio.h>
#include <ctype.h>
// header file for toupper( )
void main ( )
{
int i , character ;
cout<<"Lower Case Series \t Upper Case Series \n" ;
for ( i = 481 ; i < 507 ; i++)
{
character = toascii (i) ;
cout<<"\t"<< char(character) <<"\t\t\t"
<< char (toupper(character));
cout<<"\n";
}
getch ( ) ;
}

Example 61 : Program to illustrate sqrt ( ) function
#include <iostream.h>
//defines the cout, cin object
#include <math.h>
// defines the sqrt( ) function
#include <conio.h>
void main ( )
{
// Tests the sqrt( ) function
for(int i =0; i < 6 ; i++)
cout<<"\t" << i << "\t" <<sqrt(i)<<endl;
getch();
}

Example 62 : Program to illustrate the abs( ) function
#include <iostream.h>
#include <math.h>
// defines the abs( ) function
#include <conio.h>
void main ( )
{
int i ;
i = -20 ;
cout<< "\n i = "<<i ;
cout<<"\n Absolute value of i = "<<abs( i ) ;
i = 20 ;
cout<< "\n i = "<<i ;
cout<<"\n Absolute value of i = "<<abs( i ) ;
getch ( ) ;
}
Example 63 : Program to illustrate the acos( ) function
#include <iostream.h>
#include <math.h>
// defines the acos( ) function
#include <conio.h>
void main ()
{
double result ;
double i = 0.5 ;
result = acos ( i ) ;
cout<<"\n The arc cosine of "<< i << " is "<< result;
getch () ;
}

Example 64 : Program to illustrate the atan( ) function
#include <iostream.h>
#include <math.h>
#include <conio.h>
void main ( )
{
double result ;

// defines the atan( ) function

double i = 0.5 ;
result = atan ( i ) ;
cout<<"\n The arc tangent of "<< i << " is "<< result;
getch () ;
}

Example 65 : Program to illustrate the ceil( ) function
#include <iostream.h>
#include <math.h>
#include <conio.h>

// defines the ceil( ) function

void main ( )
{
double number = 29.92 ;
double result ;
result = ceil ( number ) ;
cout<< "\n Original number = "<< number ;
cout<< "\n Number rounded up = "<< result ;
getch () ;
}

Example 66 : Program to illustrate the fabs( ) function
#include <iostream.h>
#include <math.h>
#include <conio.h>

// defines the fabs( ) function

void main ( )
{
float i = -20.56;
cout.precision(2);
cout<<" i = "<<i;
cout<<"\n Absolute value of i = "<<fabs(i);
i = 20.56 ;
cout<<" i = "<<i;
cout<<"\n Absolute value of i = "<<fabs(i);
getch () ;

}

Example 67 : Program to illustrate the exp( ) function
#include <iostream.h>
#include <math.h>
#include <conio.h>

// defines the exp( ) function

void main ( )
{
double result;
double x = 2.0 ;
result = exp ( x ) ;
cout<< "\n The result is : "<< result ;
getch ( ) ;
}

Example 68 : Program to illustrate the pow ( ) function
#include <iostream.h>
#include <math.h>
// defines the pow ( ) function
#include <conio.h>
void main ( )
{
double result;
double x = 10, y = 2 ;
result = pow ( x, y ) ;
cout<<"\n"<<x<<" to the power "<<y<<" = "<<result ;
getch ( ) ;
}

Example 69 : Program to illustrate the log ( ) function
#include <iostream.h>
#include <math.h>
// defines the log ( ) function
#include <conio.h>
void main ( )
{
double result;
double x = 0.5 ;

result = log ( x ) ;
cout<<" \n The natural log of "<< x <<" is "<<result ;
getch () ;
}
Example 70 : Program to illustrate the log10 ( ) function
#include <iostream.h>
#include <math.h>
// defines the log10 ( ) function
#include <conio.h>
void main ( )
{
double result;
double x = 10 ;
result = log10( x ) ;
cout<<" \n The natural log of "<< x <<" is "<<result ;
getch () ;
}

Example 71 : Program to illustrate the abort( )function */
#include <iostream.h>
#include <process.h>
// defines the abort( )function
#include <conio.h>
void main ( )
{
cout<< "\n Calling abort( )\n" ;
abort( ) ;
getch ( ) ;
/* This is never reached */
}

Example 72 : Program to illustrate the exit( ) function
#include <iostream.h>
#include <process.h>
// defines the exit( ) function
#include <conio.h>
void main ( )
{
cout<< "\n Calling exit( ) \n" ;
exit(0);

getch ( ) ;

/* This is never reached */

}
Example 73 : Program to illustrate the atoi( ) function
#include<iostream.h>
#include<conio.h>
#include<stdlib.h >
// defines the atoi( ) function
void main()
{
int i ;
char *string = "145.97" ;
i = atoi ( string ) ;
cout<< "string = "<<string<<"\t integer = "<<i;
getch ( ) ;
}

Example 74 : Program to illustrate the atol( ) function
#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
// defines the atol( ) function
void main()
{
long i ;
char *string = "123459" ;
i = atol ( string ) ;
cout<< "string = "<<string<<"\t integer = "<<i;
getch () ;
}
Example 75 : Program to illustrate the itoa( ) function
#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
void main ( )
{
int i = 102 ;

// defines the itoa( ) function

char *string ;
itoa ( i, string, 10 ) ;
cout<<"integer = "<<i<<"\t string = "<<string;
getch ( ) ;
}
Example 76 : Program to illustrate the labs( ) function
#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
// defines the labs( ) function
void main ( )
{
long i ;
i = -12345678L ;
cout<<"\n i = "<<i ;
cout<<"\n Absolute value of i = "<<labs(i);
i = 12345678L ;
cout<<"\n\n i = "<<i ;
cout<<"\n Absolute value of i = "<<labs(i);
getch() ;
}

Example 77 : Program to illustrate the ltoa( ) function
#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
// defines the ltoa( ) function
void main ( )
{
long i = 50223 ;
char *string ;
ltoa ( i, string, 10 ) ;
cout << "\n integer = " << i << "\t string = " << string;
getch () ;
}

Example 78 : Program to illustrate the max( ) function
#include<iostream.h>
#include<conio.h>

#include<stdlib.h>
// defines the max( ) function
void main()
{
int x = 5;
int y = 6;
int z;
z=max(x,y);
cout<<"\nThe maximum number is "<<z ;
getch() ;
}
Example 79 : Program to illustrate the min( ) function
#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
// defines the min( ) function
void main ( )
{
int x = 1, y = 7, z ;
z=min(x,y) ;
cout<<"\nThe minimum number is "<<z ;
getch();
}

Example 80 : Program to illustrate the rand( ) function
#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
// defines the rand( ) function
void main ( )
{
int z ;
z = rand ( ) ;
cout<< "\n The 1st random number is "<<z ;
z = rand () ;
cout<< "\n The 2nd random number is "<<z ;
getch ( ) ;
}

Example 81 : Program to illustrate Local Variables
#include<iostream.h>
void show(int j)
{
int k = 45 ;
cout<<"\n value of j : "<<j;
cout<<"\n value of k : "<<k;
}
void main( )
{
int i =200;
show( i);
}

// Local Variable Declaration

// Local Variable Declaration

Example 82 : Program to illustrate Pointer
#include <iostream.h>
void main( )
{
int i = 5 ;
cout <<" \n Address of i = "<< &i ;
cout <<" \n Value of i = "<< i ;
}
Example 83 : Program to illustrate Pointer
#include <iostream.h>
#include<conio.h>
void main( )
{
int i = 5 ;
cout <<" \n Address of i = " << &i ;
cout <<" \n Value of i = " << i ;
cout <<" \n Value of i = " << *(&i) ;
getch();
}

Example 84 : Program to illustrate Pointer variable
#include <iostream.h>

void main( )
{
int i = 5 ;
int * j ;
// Declaration of Pointer Variable
j = &i ;
// Assigning address of variable i to variable j
cout <<" \n Address of i = " << &i ;
cout <<" \n Address of i = " << j ;
cout <<" \n Value of i = " << i ;
cout <<" \n Value of i = " << *(&i) ;
cout <<" \n Value of i = " << *j ;
}

Example 85 : Program for Macro with Arguments
#include <iostream.h>
#include <conio.h>
/* macro definition */
#define xyz(a)
b=a*2;
void main()
{
int x = 3, b ;
clrscr () ;
xyz ( x ) ;
/* call to macro 'xyz' */
cout << "After first call to the macro 'xyz'...\n" ;
cout << "b =" << b ;
xyz ( x + 5 ) ;
/* call to macro 'xyz' */
cout <<"\n\nAfter second call to the macro 'xyz'...\n";
cout << "b = " << b ;
getch () ;
}

Example 86 : Program for Use of '#ifdef'
#include <iostream.h>
#include <conio.h>
#define print 1
/* macro 'print' definition */
void main()
{
int a = 10 ;
clrscr () ;
a=a+1;
#ifdef print
/* if macro 'print' defined */
cout << "a = " << a ;

#endif
getch () ;
}

Example 87 : Program for use of '#ifdef' with '#else'
#include <iostream.h>
#include <conio.h>
/* macro named 'print' is not defined */
void main()
{
int a = 10 ;
clrscr () ;
a=a+1;
#ifdef print
/* if macro 'print' defined */
cout << "a = " << a ;
#else
/* if macro 'print' is not defined */
cout << "The macro 'print' is not defined" ;
#endif
getch () ;
}
Example 88 : Program for Use of '#if'
#include <iostream.h>
#include <conio.h>
#define pi 3.142
void main()
{
clrscr () ;
#if pi == 3.142
cout << "The value of pi = " << pi ;
#else
cout << "The value of pi is not defined as 3.142" ;
#endif
getch () ;
}

Example 89 : Program for Use of '#if' with '#elif'
#include <iostream.h>
#include <conio.h>

#define m 2
void main()
{
clrscr () ;
#if m == 1
cout << " 'm' is One" ;
#elif m == 2
cout << " 'm' is Two" ;
#elif m == 3 || m == 4 || m == 5
cout << " 'm' is Between Three and Five" ;
#elif m >= 6 && m <= 10
cout << " 'm' is between Six and Ten" ;
#else
cout << " 'm' is not in the range [1-10]" ;
#endif
getch () ;
}
Example 90 : Program for Use of '#if' as '#ifdef'
#include <iostream.h>
#include <conio.h>
#define print 1
/* macro 'print' definition */
void main()
{
int a = 10 ;
clrscr () ;
a=a+1;
#if defined (print) /* if macro 'print' defined */
cout << "a = " << a ;
#endif
getch () ;
}

Example 91 : Program for Use of '#undef'
#include <iostream.h>
#include <conio.h>
#define pi 3.14
void main()
{
clrscr () ;
#if pi == 3.142
cout << "The value of pi = " << pi ;
#else
#undef pi
/* remove the definition of 'pi' */
#define pi 3.142
/* redefine 'pi' */
cout << "The modified value of pi = " << pi ;
#endif
getch ();
}

Example 92 : Program for Use of '#pragma startup' and '#pragma exit'
#include <iostream.h>
#include <conio.h>
/* functions declared before the 'pragma' lines */
void start ( void ) ;
void end ( void ) ;
/* 'pragma' directives */
#pragma startup start
#pragma exit end
void main()
{
cout << "\n\nProgram Body\n\n\n" ;
getch () ;
}
void start (void) /* function to be called before 'main()' */
{
clrscr () ;
cout << "PROGRAM STARTS HERE...\n" ;
getch () ;
}
void end (void) /* function to be called before program termination */
{

cout << "PROGRAM ENDS HERE...\n" ;
getch () ;
}

Example 93 : Program for Use of '#define' for constant definition
#include <iostream.h>
#include <conio.h>
#define size 5
/* constant definition */
void main()
{
int a[size] ;
/* use of synonym 'size' */
int i ;
clrscr () ;
for ( i = 0; i < size; i++ )
/* use of synonym 'size' */
a[i] = i ;
cout<< "The array elements are :\n" ;
for ( i = 0; i < size; i++ ) /* use of synonym 'size' */
cout <<a[i];
getch () ;
}

Example 94 : Program for Use of '#define' for macro definition
#include <iostream.h>
#include <conio.h>
/* macro definition */
/* macro definition if requires more than one program lines as
below, it can be continued on the next line with the help of
a special character used by '#define' which is '

written
at the end of each program line of the macro. */
#define xyz \
cout<<"\nThe array elements are :\n"; \
for ( i = 0; i < 5; i++ ) \
cout << a[i];
void main()
{
int a[5], i ;
clrscr () ;
for ( i = 0; i < 5; i++ )

a[i] = i ;
xyz ;
/* use of call to a macro */
for ( i = 0; i < 5; i++ )
a[i] -= 1 ;
xyz ;
/* use of call to a macro */
getch () ;
}

Example 95 : Program for Use of '#ifndef'
#include <iostream.h>
#include <conio.h>
/* macro named 'print' is not defined */
void main()
{
int a = 10 ;
clrscr () ;
a=a+1;
#ifndef print
/* if macro 'print' is not defined */
cout << "The macro 'print' is not defined" ;
#else
/* if macro 'print' is defined */
cout << "a = " << a ;
#endif
getch () ;
}

Example 96 : Program that returns the average of 4 numbers
# include <iostream.h>
double avg ( double, double, double, double) ;
void main( )
{
int w, x, y, z;
cout<<"\n Enter four integers : ";
cin>>w>>x>>y>>z;
cout<<"\n Their average is "<<avg(w,x,y,z)<<endl;
}
double avg ( double n1, double n2, double n3, double n4)
{
return ( n1 + n2 + n3 + n4) /4.0 ;
}

Example 97 : Program that returns the minimum of 4 integers
# include <iostream.h>
int min (int, int, int, int);
void main( )
{
int w, x, y, z;
cout<<"\n Enter four integers : ";
cin>>w>>x>>y>>z;
cout<<"\n Their minimum is "<<min(w,x,y,z)<<endl;
}
int min ( int n1, int n2, int n3, int n4)
{
int min = n1;
if (n2 < min) min = n2 ;
if (n3 < min) min = n3 ;
if (n4 < min) min = n4 ;
return min;
}

Example 98 : Program to find factorial of -1 to 6 numbers
#include <iostream.h>
#include <conio.h>
long factorial (int i);
//Declaration (Prototype)
void main( )
{
for( int i = -1 ; i < 7; i++)
cout<<"fact ( " << i << " ) = "<<fact(i)<<endl;
getch( );
}
long factorial ( int n)
{
if (n < 2) return 1;
long f = 1;
for ( int i = 2; i < = n ; i++)
f*=i;
return (f );
}

Example 99 : Program for Permutation Function
# include <iostream.h>
long perm (int n, int k);
void main( )
{
for (int i = -1; i < 6; i++)
{
for (int j = -1 ; j <= i+1; j++)
cout<<" " <<perm (i, j) ;
cout<<endl;
}
}
long perm( int n, int k)
{
if (n < 0 || k < 0 || k > n) return 0;
int p = 1;
for (int i = 1; i <=k; i++ , n--)
p *= n ;
return p ;
}

Example 100 : Program for combination Function
# include <iostream.h>
long comb (int , int );
// Function Declaration
void main( )
{
for (int i = -1; i < 9; i++)
{
for (int j = -1 ; j <= i+1; j++)
cout<<" " <<comb (i, j) ;
cout<<endl;
}
}
long perm( int , int );
// Function Declaration
long fact (int);
long comb(int n, int k)
{

if (n < 0 || k < 0 || k > n) return 0;
return perm(n,k)/fact(k);
}
long perm( int n, int k)
{
if (n < 0 || k < 0 || k > n) return 0;
int p = 1;
for (int i = 1; i <=k; i++ , n--)
p *= n ;
return p ;
}
long fact ( int n)
{
if (n < 2) return 1;
long f = 1;
for ( int i = 2; i <= n ; i++)
f *= i ;
return (f );
}

Example 101 : Program to print Pascal's Triangle
#include <iostream.h>
#include<iomanip.h>
long comb (int , int );
// Function Declaration
void main( )
{
const int m = 9;
int j;
for (int i = 0; i < m; i++)
{
for (j = 1 ; j < m - i; j++)
cout<<setw(2)<<" ";
//print whitespace
for (j = 0 ; j <= i; j++)
cout << setw(4) << comb( i, j);
cout<<endl;
}
}
long comb(int n, int k)
{
if (n < 0 || k < 0 || k > n) return 0;
long c = 1;

for ( int i =1; i <= k; i++, n--)
c = c * n/i ;
return c;
}

Example 102 : Program that extracts a digit from an integer
# include <iostream.h>
# include<conio.h>
int digit (long, int);
void main( )
{
int n , k;
cout<<"\n Integer : " ;
cin>>n;
do
{
cout << "\n Digit :";
cin >> k;
cout<<"\nDigit number " << k <<" of "<< n
<<" is "<< digit(n, k) << endl;
}while (k > 0);
}
int digit (long n, int k)
{
for( int i = 0; i < k; i++)
n /= 10;
//remove right-most digit
return (n % 10);
}

Example 103 : Program that determines whether the given integer is a square
number
# include <iostream.h>
# include<conio.h>
int isSquare (int);
int main( )
{
const int MAX = 20;

for ( int i =0; i < MAX; i++)
if (isSquare(i) )
cout<<i<<" is square. \n";
else
cout<<i<<"is not square. \n";
getch( );
return 0;
}
int isSquare( int n)
{
int i =0;
while ( i*i < n)
++i;
if ( i* i == n) return 1;
else return 0 ;
}

Example 104 : Program to compute Area & circumference of circle
# include <iostream.h>
# include<conio.h>
void computecircle(float*,float*, float );
void main( )
{
float a,c,r;
cout<<"\n Enter the radius : ";
cin>>r;
computecircle(&a,&c,r);
cout<<"n The area of a circle of radius "<<r<<" is "<<a
<<"\n and its circumference is " <<c<<endl;
}
void computecircle(float *area, float *circ, float r )
{
const double PI=3.141592653589793;
*area = PI*r*r;
*circ = 2*PI*r;
}

Example 105 : Program to compute Sum & average of elements in array
# include <iostream.h>

# include<conio.h>
int sum (int[ ], int);
float avg (int[ ], int);
void main( )
{
int a[ ]={11,33,55,77};
int size = sizeof(a) /sizeof(int);
cout<<"Sum (a, size) = "<<sum(a,size)<<endl;
cout<<"Average (a, size) = "<<avg(a,size)<<endl;
}
int sum(int a[ ], int n)
{
int sum1 = 0;
for(int i = 0; i < n; i++)
sum1= sum1+a[i] ;
return sum1;
}
float avg (int a[ ], int n)
{
float sum = 0.0;
for(int i = 0; i < n; i++)
sum= sum +a[i] ;
return sum/n;
}
Example 106 : Program to search a given integer in an array of integers
# include <iostream.h>
# include<conio.h>
int search(int[], int);
void main( )
{
int arr[10], num, i, subscript;
cout<<"\n Input 5 array elements : ";
for(i=0;i<5;i++)
cin>>arr[i];
cout<<"\n Enter number to be searched :";
cin>>num;
if((subscript = search(arr,num)) == -1)
cout<<"\n No such element !! ";
else
cout<<"\n Element found at : "<<subscript;
getch( );

}
int search(int arr[], int num)
{
int i ;
for(i=0; i<5; i++)
{
if (arr[i] == num)
return i +1;
}
return -1;
}

Example 107 : Program to implement Binary Search
# include <iostream.h>
# include<conio.h>
void main( )
{
int list[20], number, result = 0;
int i, n, low ,mid, high;
cout<<"\n Enter the number of elements : ";
cin>>n;
cout<<"\n Enter elements in ascending order : \n";
for(i=0; i<n; i++)
cin>>list[i];
cout<<"\n Enter the number to be searched : ";
cin>>number;
low = 0;
high = n-1;
while(low <= high)
{
mid = (low+ high) / 2;
if (number < list [mid])
high = mid - 1;
else if(number > list[mid])
low = mid + 1;
else
{
result = list[mid];
break;
}
}

if (result == 0)
cout<<"\n No match found";
else if(result != 0)
{
cout<<"\n Match found \n";
cout<< "Position of number "<< number<<" is : "<<mid +1;
}
}

Example 108 : Program to Check for symmetric matrix
# include <iostream.h>
# include<conio.h>
void main( )
{
int i, j, matrix[3][3], flag = 0;
cout<<"\n Input 3 × 3 matrix elements :\n";
for (i=0;i<3;i++)
for(j=0;j<3;j++)
cin>>matrix[i][j];
for (i=0;i<3;i++)
for(j=0;j<3;j++)
if (matrix[i][j] != matrix[j][i])
flag = 1;
if (flag == 1)
cout<<"\n Matrix is not symmetric";
else
cout<<"\n Matrix is symmetric";
}

Example 109 : Program to Sort the matrix in ascending order
# include <iostream.h>
# include<conio.h>
void main( )
{
int matrix[3][3], sort[9], i, j, temp, k=0;
cout<<"\n Input 3 × 3 matrix elements : \n";

for (i=0;i<3;i++)
for (j=0;j<3;j++)
cin>>matrix[i][j];
for (i=0; i<3; i++)
// copy into an array for sorting
for (j=0; j<3; j++)
sort[k++] = matrix[i][j];
for (i=0; i<9; i++)
//sort the copied array
for (j=i+1; j<9; j++)
{
if (sort[i] > sort[j])
{
temp = sort[i];
sort[i] = sort[j];
sort[j] = temp;
}
}
cout<<"\n Sorted matrix is : \n ";
for ( k=0, i=0, j=0; k<9; k++)
//copy back to the matrix
{
if (j == 3)
{
j = 0;
i ++;
cout<<"\n";
}
matrix[i][j] = sort[k];
cout << matrix[i][j];
//print sorted matrix.
j++;
}
getch( );
}

Example 110 : Program to count number of times the word 'the' appears in the
string
# include <iostream.h>
# include<conio.h>
#include<string.h>
#include<stdio.h>
void main( )
{
char s[20], s1[20], *p = " ";

int i , count = 0;
cout<<"\n Input the String : \n";
gets(s);
strcpy(s1,s);
p = strtok(s1," ") ;
// get the first word
for( i = 0 ;p;i++)
{
if (strcmp (p,"the") == 0 )
count++;
p = strtok(NULL," " );
//get the next word
}
cout<<"\n Count is : "<<count ;
}

Example 111 : Program to check for a palindrome number
# include <iostream.h>
# include<conio.h>
#include<string.h>
#include<stdlib.h>
void main( )
{
int num, n, flag = 0, i=0;
char s[10];
cout<<"\n Input an integer : ";
cin>>num;
itoa (num,s,10);
//convert int to string
n = strlen(s) -1;
while(s[i] != '###BOT_TEXT###')
{
if (s[i] != s[n-i])
{
flag = 1;
break;
}
i++;
}
if (flag == 1)
cout<<"\n Number is not Palindrome";
else

cout<<"\n Number is Palindrome";
getch( );
}

Example 112 : Program to check whether entered string is a palindrome or not
# include <iostream.h>
# include<conio.h>
#include<string.h>
int is_palindrome(char* str)
{
int n, flag, i =0;
n= strlen (str);
while(*(str+i)!='###BOT_TEXT###')
{
if(*(str+i)!=*(str+(n-i-1)))
{
flag = 1;
break;
}
i++;
}
if(flag == 1)
return 0;
else
return 1;
}
void main( )
{
char s[20];
cout<<"\n Enter a String : ";
cin>>s;
if (is_palindrome(s))
cout<<"\n Input string is a palindrome String ";
else
cout<<"\n Input string is not a palindrome String ";
getch( );
}

Example 113 : Program to accept a 3 digit number and print it out digit by digit as a
series of words.
# include <iostream.h>
# include<conio.h>
void main( )
{
int n;
char s[10][6]={ "Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven",
"Eight", "Nine"};
cout<<"\n Enter 3 digit number : ";
cin >> n;
cout<< "\n The Number is : " <<n ;
cout<<"\n"<<s[n/100];
n = n % 100;
cout<<" "<<s[n/10];
n = n % 10;
cout<<" "<<s[n/1];
getch( );
}

Example 114 : Program which concatenates a string to the left of a given string
# include <iostream.h>
# include<conio.h>
#include<string.h>
void main( )
{
char *s1="Good", *s2= "Day", *s3;
s3 = s2 + (strlen(s2)-1); // s3 points to last character of s2
while(*s2 != '###BOT_TEXT###')
{
*--s1=*s3--;
s2++;
}
cout<<s1;
//print concatenated string
getch( );
}

Example 115 : Program to find factorial of number using non-recursive function
#include <iostream.h>
#include <conio.h>
int factorial (int i);
//Declaration (Prototype)
void main( )
{
int a, fact;
cout<<"\n Enter any Number : " ;
cin>>a;
fact = factorial( a ) ;
cout<<"\n Factorial value : " << fact ;
getch( );
}
int factorial ( int x)
{
int f =1, i ;
for (i = x; i >= 1; i--)
f=f*i;
return (f );
}

Example 116 : Program to find factorial of number using Recursive Function
#include <iostream.h>
#include <conio.h>
int recur (int i);

//Declaration (Prototype)

void main( )
{
int a, fact;
cout<<"\n Enter any Number : " ;
cin>>a;
if ( a < 0)
cout<<"\n Number should be positive !! ";
else
{
fact = recur ( a ) ;
cout<<"\n Factorial value : " << fact ;

}
getch( );
}
int recur ( int n)
{
if ( n == 1 )
return (1);
else
return (n * recur ( n - 1 ) );
}

Example 117 : Program to illustrates Recursion
#include <iostream.h>
int addition ( int n ) ;
void main ()
{
int n ;
cout<< "\n Input n : ";
cin >> n;
if ( n <= 0 )
cout<< "\n Number should be greater than zero !!!";
else
cout<< "\n Sum of 1 to "<<n<< " = "<< addition ( n ) ;
}
int addition ( int n )
{
if ( n == 1 )
return ( 1 ) ;
else
return ( n + addition ( n - 1 ) ) ;
}

Example 118 : Program to illustrates passing by reference
#include<iostream.h>
#include<conio.h>
void swap (int&, int&) ;
void main( )
{
int a = 11, b = 22;
cout <<"\n Before swap a = "<<a<<" and b = "<<b;

swap(a, b);
cout <<"\n After swap a = "<<a<<"and b = "<<b;
}
void swap(int& x, int& y)
{
//exchange the values of x and y
int temp = x;
x = y;
y = temp;
}
Example 119 : Program to illustrates Static Storage Classes
#include<iostream.h>
void incre( ) ;
void main( )
{
incre( );
incre( );
incre( );
incre( );
}
void incre( )
{
static int i = 1;
cout << "\n" <<i ;
i = i + 1;
}

Example 120 : Program to illustrates strlen( ) function
#include <iostream.h>
#include <conio.h>
#include <string.h>
void main( )
{
char s[ ] = "Hello";
cout<<" strlen ( "<<s<<" ) = "<<strlen(s) <<endl;
cout<<" strlen ( ###BOT_TEXT###quot;###BOT_TEXT###quot; ) = "<<strlen("") <<endl;
char buff[20];
cout<<"Enter String : " ;
cin>>buff;
cout<<" strlen ( "<<buff <<" ) = "<<strlen(buff) <<endl;
getch( );

}

Example 121 : Program to illustrates strcpy ( ) function
#include <iostream.h>
#include <conio.h>
#include <string.h>
void main( )
{
char s1[20 ] = "Hello";
char s2[ ] = "Hi";
cout<<"Before strcpy (s1,s2) : \n";
cout<<" \t s1 = [ " <<s1 << "] , length = " <<strlen(s1)<<endl;
cout<<" \t s2 = [ " <<s2 << "] , length = " <<strlen(s2)<<endl;
strcpy(s1,s2) ;
cout<<"After strcpy (s1,s2) : \n";
cout<<" \t s1 = [ " <<s1 << "] , length = " <<strlen(s1)<<endl;
cout<<" \t s2 = [ " <<s2 << "] , length = " <<strlen(s2)<<endl;
getch( );
}
Example 122 : Program to illustrates strcat ( ) function
#include <iostream.h>
#include <conio.h>
#include <string.h>
void main( )
{
char s1[20 ] = "Hello";
char s2[ ] = "Sir";
cout<<"Before strcat (s1,s2) : \n";
cout<<" \t s1 = [ " <<s1 << "] , length = " <<strlen(s1)<<endl;
cout<<" \t s2 = [ " <<s2 << "] , length = " <<strlen(s2)<<endl;
strcat(s1,s2) ;
cout<<"After strcat (s1,s2) : \n";
cout<<" \t s1 = [ " <<s1 << "] , length = " <<strlen(s1)<<endl;
cout<<" \t s2 = [ " <<s2 << "] , length = " <<strlen(s2)<<endl;
getch( );
}

Example 123 : Program to illustrates strcat ( ) function
#include <iostream.h>
#include <conio.h>
#include <string.h>
void main( )
{
char s1[20 ] = "Hello";
char s2[ ] = "Sir";
cout<<"Before strcat (s1,s2) : \n";
cout<<" \t s1 = [ " <<s1 << "] , length = " <<strlen(s1)<<endl;
cout<<" \t s2 = [ " <<s2 << "] , length = " <<strlen(s2)<<endl;
strcat(s1,s2) ;
cout<<"After strcat (s1,s2) : \n";
cout<<" \t s1 = [ " <<s1 << "] , length = " <<strlen(s1)<<endl;
cout<<" \t s2 = [ " <<s2 << "] , length = " <<strlen(s2)<<endl;
getch( );
}
Example 124 : Program to illustrates strcmp( ) function
#include <iostream.h>
#include <conio.h>
#include <string.h>
void main( )
{
char s1[] = "Merry";
char s2[] = "Herry";
int i, j, k;
i = strcmp(s1,"Merry");
j = strcmp(s2, "Herry");
k = strcmp(s1,s2);
cout<<"\n"<<i<<"\t"<<j<<"\t"<<k;
getch( );
}

Example 125 : Program to illustrates strtok( ) functions
#include <iostream.h>
#include <conio.h>
#include <string.h>

void main ( )
{
char source [] = "Hello, Have a Nice Day" ;
char *p;
cout<< "\n Source String is : "<<source ;
/* strtok( ) places a NULL terminator
in front of the token, if found */
p = strtok ( source, "," ) ;
if ( p )
cout<< "\n First Token : "<<p;
/* A second call to strtok( ) using a NULL
as the first parameter returns a pointer
to the character following the token */
p = strtok ( NULL, " " ) ;
if ( p )
cout<< "\n Second Token : "<<p;
/* Similarly other tokens can be obtained */
p = strtok ( NULL, " " ) ;
if ( p )
cout<< "\n Third Token : "<<p;
getch ( ) ;
}

Example 126 : Program to illustrates strncat( ), strnset( ) and strncmp( ) functions
#include <iostream.h>
#include <conio.h>
#include <string.h>
void main()
{
char s1[] = "Apple" , s2[] = "mango" , c = 'v';
int n = 3 , m ;
puts ("String 1 - ") ;
puts (s1) ;
strncat (s1,s2,n) ;
puts ("Result of strncat( ) - ") ;
puts (s1) ;

puts ("Set String 1 - ") ;
strnset (s1,c,n) ;
puts (s1) ;
puts ("String 2 - ") ;
puts (s2) ;
n=4;
m = strncmp (s2,s1,n) ;
puts ("Result of strncmp( ) - ") ;
cout<<m ;
getch ( ) ;
}

Example 127 : Program to illustrates External Storage Classes
#include<iostream.h>
int i ;
//External variable
void decre( );
void incre( ) ;
void main( )
{
cout << "\n i = "<<i ;
incre( );
incre( );
decre( );
decre( );
}
void incre( )
{
i = i + 1;
cout << "\n On incrementing i = " << i ;
}
void decre( )
{
i = i - 1;
cout << "\n On decrementing i = " << i ;
}

Example 128 : Program to illustrates String
#include <iostream.h>
#include <conio.h>
void main( )
{
char str[ ] = "Hello";
int i = 0;
while (i<=4)
{
cout << str[i];
i++;
}
getch( );
}

Example 129 : Program to illustrates String
#include <iostream.h>
#include <conio.h>
void main( )
{
char str[ ] = "Hello";
int i = 0;
while (str[i]!='###BOT_TEXT###')
{
cout << str[i];
i++;
}
getch( );
}

Example 130 : Program to illustrates String
#include <iostream.h>
#include <conio.h>
void main( )
{
char str[ ] = "Hello";
char *ptr ;
ptr = str;
//store base address of string
while (*ptr !='###BOT_TEXT###')
{
cout << *ptr;
ptr++;
}
getch( );
}

Example 131 : Program to illustrates String
#include <iostream.h>
#include <conio.h>
void main( )
{
char str[] = "Hello";
cout<<str;
getch( );
}

Example 132 : Program to illustrates String
#include <iostream.h>
#include <conio.h>
void main( )
{
char str[20] ;
cout<<"\n Enter any string :";
cin>>str;
cout<<"\n The string is :"<<str;
getch( );
}

Example 133 : Program to illustrates gets( ) & puts( ) function
#include <iostream.h>
#include <conio.h>
#include<stdio.h>
void main( )
{
char str[20] ;
cout << "\n Enter any string :" ;
gets(str);
puts( " The string is : " ) ;
puts(str) ;
getch( );
}
/*
Output:
Enter any string : Hello
The string is :
Hello
*/

Example 134 : Program to calculate Length of String
#include <iostream.h>
#include <conio.h>
#include<stdio.h>
char line[40] ;
int calculate_length ( ) ;
void main ()
{
int length ;
cout <<" Enter a string : " ;
gets(line) ;
length = calculate_length ( ) ;
cout<<" \nThe string length is "<<length ;
getch ( ) ;
}
int calculate_length ( )

{
int count = 0 ;
while (line[count] != '###BOT_TEXT###')
count++ ;
return (count) ;
}
Example 135 : Program to Copy a String
#include <iostream.h>
#include <conio.h>
#include<stdio.h>
void main ( )
{
int i ;
char sentence[40] , copy[40] ;
cout<<"Enter any string :" ;
gets (sentence) ;
i=0;
for (i=0 ; i<40 ; i++)
copy[i] = 0 ;
i=0;
while (sentence[i] != '###BOT_TEXT###')
{
copy[i] = sentence[i] ;
i++ ;
}
cout<<"\nThe copied string is : " ;
puts (copy) ;
getch ( ) ;
}
Example 136 : Program to perform Concatenation of Strings
#include <iostream.h>
#include <conio.h>
#include<stdio.h>
void concatenate (char str1[40],char str2[40]) ;
void main ()
{
char str1[60] , str2[40] ;
puts ("Enter the first string :") ;
gets (str1) ;
puts ("\nEnter the second string :") ;

gets (str2) ;
concatenate (str1,str2) ;
puts ("\nThe concatenated string is :") ;
puts (str1) ;
getch ( ) ;
}
void concatenate (char str1[40], char str2[40])
{
int i, j;
i=0;
while (str1[i] != '###BOT_TEXT###')
i++ ;
str1[i] = ' ' ;
i++ ;
j=0;
while (str2[j] != '###BOT_TEXT###')
{
str1[i] = str2[j] ;
i++ ;
j++ ;
}
}

Example 137 : Program to perform Comparisons of Two Strings
#include <iostream.h>
#include <conio.h>
#include<stdio.h>
int compare (int i,char str1[],char str2[]);
void main ( )
{
int i , j , count = 0 ;
char str1[40],str2[40] ;
for (i=0 ; i<40 ; i++)
{
str1[i] = '###BOT_TEXT###' ;
str2[i] = '###BOT_TEXT###' ;
}
puts ("Enter the first string :") ;
gets (str1);
puts ("\nEnter the second string :") ;
gets (str2);
count = compare (i,str1,str2);

if ( (str1[count] == '###BOT_TEXT###')&&(str2[count]=='###BOT_TEXT###'))
puts ("\nThe two strings are equal.") ;
else
puts ("\nThe two strings are unequal.") ;
getch ( ) ;
}
int compare (int i,char str1[],char str2[])
{
i=0;
while ((str1[i]==str2[i])&&(str1[i]!='###BOT_TEXT###')&&(str2!='###BOT_TEXT###'))
++i ;
return (i) ;
}

Example 138 : Program to perform Reversal of String
#include <iostream.h>
#include <conio.h>
#include<stdio.h>
void main ( )
{
int count , i ;
char line[40] , reverse[40] ;
puts ("Enter A String - ") ;
gets (line) ;
count = 0 ;
while (line[count] != '###BOT_TEXT###')
count++ ;
count-- ;
for(i=0 ; i<40 ; i++)
reverse[i] = 0 ;
i=0;
while (count >= 0)
{
reverse[count] = line[i] ;
count-- ;
i++ ;
}
puts ("\nThe reversed string is - ") ;
puts (reverse) ;
getch ( ) ;
}

Example 139 : Program to illustrate Difference between Call by Value & Call by
Reference
#include <iostream.h>
#include <conio.h>
void f (int, int &);
void main( )
{
int a = 22, b = 44;
cout<<" a = "<<a <<",
f(a,b);
cout<<" a = "<<a <<",
f(2*a-3,b);
cout<<" a = "<<a <<",
getch();
}
void f(int x, int *y)
{
x = 88;
* y = 99;
}

b = " <<b<<endl;
b = " <<b<<endl;
b = " <<b<<endl;

written
at the end of each program line of the macro. */
#define xyz \
cout<<"\nThe array elements are :\n"; \
for ( i = 0; i < 5; i++ ) \
cout << a[i];
void main()
{
int a[5], i ;
clrscr () ;
for ( i = 0; i < 5; i++ )

a[i] = i ;
xyz ;
/* use of call to a macro */
for ( i = 0; i < 5; i++ )
a[i] -= 1 ;
xyz ;
/* use of call to a macro */
getch () ;
}

Example 95 : Program for Use of '#ifndef'
#include <iostream.h>
#include <conio.h>
/* macro named 'print' is not defined */
void main()
{
int a = 10 ;
clrscr () ;
a=a+1;
#ifndef print
/* if macro 'print' is not defined */
cout << "The macro 'print' is not defined" ;
#else
/* if macro 'print' is defined */
cout << "a = " << a ;
#endif
getch () ;
}

Example 96 : Program that returns the average of 4 numbers
# include <iostream.h>
double avg ( double, double, double, double) ;
void main( )
{
int w, x, y, z;
cout<<"\n Enter four integers : ";
cin>>w>>x>>y>>z;
cout<<"\n Their average is "<<avg(w,x,y,z)<<endl;
}
double avg ( double n1, double n2, double n3, double n4)
{
return ( n1 + n2 + n3 + n4) /4.0 ;
}

Example 97 : Program that returns the minimum of 4 integers
# include <iostream.h>
int min (int, int, int, int);
void main( )
{
int w, x, y, z;
cout<<"\n Enter four integers : ";
cin>>w>>x>>y>>z;
cout<<"\n Their minimum is "<<min(w,x,y,z)<<endl;
}
int min ( int n1, int n2, int n3, int n4)
{
int min = n1;
if (n2 < min) min = n2 ;
if (n3 < min) min = n3 ;
if (n4 < min) min = n4 ;
return min;
}

Example 98 : Program to find factorial of -1 to 6 numbers
#include <iostream.h>
#include <conio.h>
long factorial (int i);
//Declaration (Prototype)
void main( )
{
for( int i = -1 ; i < 7; i++)
cout<<"fact ( " << i << " ) = "<<fact(i)<<endl;
getch( );
}
long factorial ( int n)
{
if (n < 2) return 1;
long f = 1;
for ( int i = 2; i < = n ; i++)
f*=i;
return (f );
}

Example 99 : Program for Permutation Function
# include <iostream.h>
long perm (int n, int k);
void main( )
{
for (int i = -1; i < 6; i++)
{
for (int j = -1 ; j <= i+1; j++)
cout<<" " <<perm (i, j) ;
cout<<endl;
}
}
long perm( int n, int k)
{
if (n < 0 || k < 0 || k > n) return 0;
int p = 1;
for (int i = 1; i <=k; i++ , n--)
p *= n ;
return p ;
}

Example 100 : Program for combination Function
# include <iostream.h>
long comb (int , int );
// Function Declaration
void main( )
{
for (int i = -1; i < 9; i++)
{
for (int j = -1 ; j <= i+1; j++)
cout<<" " <<comb (i, j) ;
cout<<endl;
}
}
long perm( int , int );
// Function Declaration
long fact (int);
long comb(int n, int k)
{

if (n < 0 || k < 0 || k > n) return 0;
return perm(n,k)/fact(k);
}
long perm( int n, int k)
{
if (n < 0 || k < 0 || k > n) return 0;
int p = 1;
for (int i = 1; i <=k; i++ , n--)
p *= n ;
return p ;
}
long fact ( int n)
{
if (n < 2) return 1;
long f = 1;
for ( int i = 2; i <= n ; i++)
f *= i ;
return (f );
}

Example 101 : Program to print Pascal's Triangle
#include <iostream.h>
#include<iomanip.h>
long comb (int , int );
// Function Declaration
void main( )
{
const int m = 9;
int j;
for (int i = 0; i < m; i++)
{
for (j = 1 ; j < m - i; j++)
cout<<setw(2)<<" ";
//print whitespace
for (j = 0 ; j <= i; j++)
cout << setw(4) << comb( i, j);
cout<<endl;
}
}
long comb(int n, int k)
{
if (n < 0 || k < 0 || k > n) return 0;
long c = 1;

for ( int i =1; i <= k; i++, n--)
c = c * n/i ;
return c;
}

Example 102 : Program that extracts a digit from an integer
# include <iostream.h>
# include<conio.h>
int digit (long, int);
void main( )
{
int n , k;
cout<<"\n Integer : " ;
cin>>n;
do
{
cout << "\n Digit :";
cin >> k;
cout<<"\nDigit number " << k <<" of "<< n
<<" is "<< digit(n, k) << endl;
}while (k > 0);
}
int digit (long n, int k)
{
for( int i = 0; i < k; i++)
n /= 10;
//remove right-most digit
return (n % 10);
}

Example 103 : Program that determines whether the given integer is a square
number
# include <iostream.h>
# include<conio.h>
int isSquare (int);
int main( )
{
const int MAX = 20;

for ( int i =0; i < MAX; i++)
if (isSquare(i) )
cout<<i<<" is square. \n";
else
cout<<i<<"is not square. \n";
getch( );
return 0;
}
int isSquare( int n)
{
int i =0;
while ( i*i < n)
++i;
if ( i* i == n) return 1;
else return 0 ;
}

Example 104 : Program to compute Area & circumference of circle
# include <iostream.h>
# include<conio.h>
void computecircle(float*,float*, float );
void main( )
{
float a,c,r;
cout<<"\n Enter the radius : ";
cin>>r;
computecircle(&a,&c,r);
cout<<"n The area of a circle of radius "<<r<<" is "<<a
<<"\n and its circumference is " <<c<<endl;
}
void computecircle(float *area, float *circ, float r )
{
const double PI=3.141592653589793;
*area = PI*r*r;
*circ = 2*PI*r;
}

Example 105 : Program to compute Sum & average of elements in array
# include <iostream.h>

# include<conio.h>
int sum (int[ ], int);
float avg (int[ ], int);
void main( )
{
int a[ ]={11,33,55,77};
int size = sizeof(a) /sizeof(int);
cout<<"Sum (a, size) = "<<sum(a,size)<<endl;
cout<<"Average (a, size) = "<<avg(a,size)<<endl;
}
int sum(int a[ ], int n)
{
int sum1 = 0;
for(int i = 0; i < n; i++)
sum1= sum1+a[i] ;
return sum1;
}
float avg (int a[ ], int n)
{
float sum = 0.0;
for(int i = 0; i < n; i++)
sum= sum +a[i] ;
return sum/n;
}
Example 106 : Program to search a given integer in an array of integers
# include <iostream.h>
# include<conio.h>
int search(int[], int);
void main( )
{
int arr[10], num, i, subscript;
cout<<"\n Input 5 array elements : ";
for(i=0;i<5;i++)
cin>>arr[i];
cout<<"\n Enter number to be searched :";
cin>>num;
if((subscript = search(arr,num)) == -1)
cout<<"\n No such element !! ";
else
cout<<"\n Element found at : "<<subscript;
getch( );

}
int search(int arr[], int num)
{
int i ;
for(i=0; i<5; i++)
{
if (arr[i] == num)
return i +1;
}
return -1;
}

Example 107 : Program to implement Binary Search
# include <iostream.h>
# include<conio.h>
void main( )
{
int list[20], number, result = 0;
int i, n, low ,mid, high;
cout<<"\n Enter the number of elements : ";
cin>>n;
cout<<"\n Enter elements in ascending order : \n";
for(i=0; i<n; i++)
cin>>list[i];
cout<<"\n Enter the number to be searched : ";
cin>>number;
low = 0;
high = n-1;
while(low <= high)
{
mid = (low+ high) / 2;
if (number < list [mid])
high = mid - 1;
else if(number > list[mid])
low = mid + 1;
else
{
result = list[mid];
break;
}
}

if (result == 0)
cout<<"\n No match found";
else if(result != 0)
{
cout<<"\n Match found \n";
cout<< "Position of number "<< number<<" is : "<<mid +1;
}
}

Example 108 : Program to Check for symmetric matrix
# include <iostream.h>
# include<conio.h>
void main( )
{
int i, j, matrix[3][3], flag = 0;
cout<<"\n Input 3 × 3 matrix elements :\n";
for (i=0;i<3;i++)
for(j=0;j<3;j++)
cin>>matrix[i][j];
for (i=0;i<3;i++)
for(j=0;j<3;j++)
if (matrix[i][j] != matrix[j][i])
flag = 1;
if (flag == 1)
cout<<"\n Matrix is not symmetric";
else
cout<<"\n Matrix is symmetric";
}

Example 109 : Program to Sort the matrix in ascending order
# include <iostream.h>
# include<conio.h>
void main( )
{
int matrix[3][3], sort[9], i, j, temp, k=0;
cout<<"\n Input 3 × 3 matrix elements : \n";

for (i=0;i<3;i++)
for (j=0;j<3;j++)
cin>>matrix[i][j];
for (i=0; i<3; i++)
// copy into an array for sorting
for (j=0; j<3; j++)
sort[k++] = matrix[i][j];
for (i=0; i<9; i++)
//sort the copied array
for (j=i+1; j<9; j++)
{
if (sort[i] > sort[j])
{
temp = sort[i];
sort[i] = sort[j];
sort[j] = temp;
}
}
cout<<"\n Sorted matrix is : \n ";
for ( k=0, i=0, j=0; k<9; k++)
//copy back to the matrix
{
if (j == 3)
{
j = 0;
i ++;
cout<<"\n";
}
matrix[i][j] = sort[k];
cout << matrix[i][j];
//print sorted matrix.
j++;
}
getch( );
}

Example 110 : Program to count number of times the word 'the' appears in the
string
# include <iostream.h>
# include<conio.h>
#include<string.h>
#include<stdio.h>
void main( )
{
char s[20], s1[20], *p = " ";

int i , count = 0;
cout<<"\n Input the String : \n";
gets(s);
strcpy(s1,s);
p = strtok(s1," ") ;
// get the first word
for( i = 0 ;p;i++)
{
if (strcmp (p,"the") == 0 )
count++;
p = strtok(NULL," " );
//get the next word
}
cout<<"\n Count is : "<<count ;
}

Example 111 : Program to check for a palindrome number
# include <iostream.h>
# include<conio.h>
#include<string.h>
#include<stdlib.h>
void main( )
{
int num, n, flag = 0, i=0;
char s[10];
cout<<"\n Input an integer : ";
cin>>num;
itoa (num,s,10);
//convert int to string
n = strlen(s) -1;
while(s[i] != '###BOT_TEXT###')
{
if (s[i] != s[n-i])
{
flag = 1;
break;
}
i++;
}
if (flag == 1)
cout<<"\n Number is not Palindrome";
else

cout<<"\n Number is Palindrome";
getch( );
}

Example 112 : Program to check whether entered string is a palindrome or not
# include <iostream.h>
# include<conio.h>
#include<string.h>
int is_palindrome(char* str)
{
int n, flag, i =0;
n= strlen (str);
while(*(str+i)!='###BOT_TEXT###')
{
if(*(str+i)!=*(str+(n-i-1)))
{
flag = 1;
break;
}
i++;
}
if(flag == 1)
return 0;
else
return 1;
}
void main( )
{
char s[20];
cout<<"\n Enter a String : ";
cin>>s;
if (is_palindrome(s))
cout<<"\n Input string is a palindrome String ";
else
cout<<"\n Input string is not a palindrome String ";
getch( );
}

Example 113 : Program to accept a 3 digit number and print it out digit by digit as a
series of words.
# include <iostream.h>
# include<conio.h>
void main( )
{
int n;
char s[10][6]={ "Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven",
"Eight", "Nine"};
cout<<"\n Enter 3 digit number : ";
cin >> n;
cout<< "\n The Number is : " <<n ;
cout<<"\n"<<s[n/100];
n = n % 100;
cout<<" "<<s[n/10];
n = n % 10;
cout<<" "<<s[n/1];
getch( );
}

Example 114 : Program which concatenates a string to the left of a given string
# include <iostream.h>
# include<conio.h>
#include<string.h>
void main( )
{
char *s1="Good", *s2= "Day", *s3;
s3 = s2 + (strlen(s2)-1); // s3 points to last character of s2
while(*s2 != '###BOT_TEXT###')
{
*--s1=*s3--;
s2++;
}
cout<<s1;
//print concatenated string
getch( );
}

Example 115 : Program to find factorial of number using non-recursive function
#include <iostream.h>
#include <conio.h>
int factorial (int i);
//Declaration (Prototype)
void main( )
{
int a, fact;
cout<<"\n Enter any Number : " ;
cin>>a;
fact = factorial( a ) ;
cout<<"\n Factorial value : " << fact ;
getch( );
}
int factorial ( int x)
{
int f =1, i ;
for (i = x; i >= 1; i--)
f=f*i;
return (f );
}

Example 116 : Program to find factorial of number using Recursive Function
#include <iostream.h>
#include <conio.h>
int recur (int i);

//Declaration (Prototype)

void main( )
{
int a, fact;
cout<<"\n Enter any Number : " ;
cin>>a;
if ( a < 0)
cout<<"\n Number should be positive !! ";
else
{
fact = recur ( a ) ;
cout<<"\n Factorial value : " << fact ;

}
getch( );
}
int recur ( int n)
{
if ( n == 1 )
return (1);
else
return (n * recur ( n - 1 ) );
}

Example 117 : Program to illustrates Recursion
#include <iostream.h>
int addition ( int n ) ;
void main ()
{
int n ;
cout<< "\n Input n : ";
cin >> n;
if ( n <= 0 )
cout<< "\n Number should be greater than zero !!!";
else
cout<< "\n Sum of 1 to "<<n<< " = "<< addition ( n ) ;
}
int addition ( int n )
{
if ( n == 1 )
return ( 1 ) ;
else
return ( n + addition ( n - 1 ) ) ;
}

Example 118 : Program to illustrates passing by reference
#include<iostream.h>
#include<conio.h>
void swap (int&, int&) ;
void main( )
{
int a = 11, b = 22;
cout <<"\n Before swap a = "<<a<<" and b = "<<b;

swap(a, b);
cout <<"\n After swap a = "<<a<<"and b = "<<b;
}
void swap(int& x, int& y)
{
//exchange the values of x and y
int temp = x;
x = y;
y = temp;
}
Example 119 : Program to illustrates Static Storage Classes
#include<iostream.h>
void incre( ) ;
void main( )
{
incre( );
incre( );
incre( );
incre( );
}
void incre( )
{
static int i = 1;
cout << "\n" <<i ;
i = i + 1;
}

Example 120 : Program to illustrates strlen( ) function
#include <iostream.h>
#include <conio.h>
#include <string.h>
void main( )
{
char s[ ] = "Hello";
cout<<" strlen ( "<<s<<" ) = "<<strlen(s) <<endl;
cout<<" strlen ( ###BOT_TEXT###quot;###BOT_TEXT###quot; ) = "<<strlen("") <<endl;
char buff[20];
cout<<"Enter String : " ;
cin>>buff;
cout<<" strlen ( "<<buff <<" ) = "<<strlen(buff) <<endl;
getch( );

}

Example 121 : Program to illustrates strcpy ( ) function
#include <iostream.h>
#include <conio.h>
#include <string.h>
void main( )
{
char s1[20 ] = "Hello";
char s2[ ] = "Hi";
cout<<"Before strcpy (s1,s2) : \n";
cout<<" \t s1 = [ " <<s1 << "] , length = " <<strlen(s1)<<endl;
cout<<" \t s2 = [ " <<s2 << "] , length = " <<strlen(s2)<<endl;
strcpy(s1,s2) ;
cout<<"After strcpy (s1,s2) : \n";
cout<<" \t s1 = [ " <<s1 << "] , length = " <<strlen(s1)<<endl;
cout<<" \t s2 = [ " <<s2 << "] , length = " <<strlen(s2)<<endl;
getch( );
}
Example 122 : Program to illustrates strcat ( ) function
#include <iostream.h>
#include <conio.h>
#include <string.h>
void main( )
{
char s1[20 ] = "Hello";
char s2[ ] = "Sir";
cout<<"Before strcat (s1,s2) : \n";
cout<<" \t s1 = [ " <<s1 << "] , length = " <<strlen(s1)<<endl;
cout<<" \t s2 = [ " <<s2 << "] , length = " <<strlen(s2)<<endl;
strcat(s1,s2) ;
cout<<"After strcat (s1,s2) : \n";
cout<<" \t s1 = [ " <<s1 << "] , length = " <<strlen(s1)<<endl;
cout<<" \t s2 = [ " <<s2 << "] , length = " <<strlen(s2)<<endl;
getch( );
}

Example 123 : Program to illustrates strcat ( ) function
#include <iostream.h>
#include <conio.h>
#include <string.h>
void main( )
{
char s1[20 ] = "Hello";
char s2[ ] = "Sir";
cout<<"Before strcat (s1,s2) : \n";
cout<<" \t s1 = [ " <<s1 << "] , length = " <<strlen(s1)<<endl;
cout<<" \t s2 = [ " <<s2 << "] , length = " <<strlen(s2)<<endl;
strcat(s1,s2) ;
cout<<"After strcat (s1,s2) : \n";
cout<<" \t s1 = [ " <<s1 << "] , length = " <<strlen(s1)<<endl;
cout<<" \t s2 = [ " <<s2 << "] , length = " <<strlen(s2)<<endl;
getch( );
}
Example 124 : Program to illustrates strcmp( ) function
#include <iostream.h>
#include <conio.h>
#include <string.h>
void main( )
{
char s1[] = "Merry";
char s2[] = "Herry";
int i, j, k;
i = strcmp(s1,"Merry");
j = strcmp(s2, "Herry");
k = strcmp(s1,s2);
cout<<"\n"<<i<<"\t"<<j<<"\t"<<k;
getch( );
}

Example 125 : Program to illustrates strtok( ) functions
#include <iostream.h>
#include <conio.h>
#include <string.h>

void main ( )
{
char source [] = "Hello, Have a Nice Day" ;
char *p;
cout<< "\n Source String is : "<<source ;
/* strtok( ) places a NULL terminator
in front of the token, if found */
p = strtok ( source, "," ) ;
if ( p )
cout<< "\n First Token : "<<p;
/* A second call to strtok( ) using a NULL
as the first parameter returns a pointer
to the character following the token */
p = strtok ( NULL, " " ) ;
if ( p )
cout<< "\n Second Token : "<<p;
/* Similarly other tokens can be obtained */
p = strtok ( NULL, " " ) ;
if ( p )
cout<< "\n Third Token : "<<p;
getch ( ) ;
}

Example 126 : Program to illustrates strncat( ), strnset( ) and strncmp( ) functions
#include <iostream.h>
#include <conio.h>
#include <string.h>
void main()
{
char s1[] = "Apple" , s2[] = "mango" , c = 'v';
int n = 3 , m ;
puts ("String 1 - ") ;
puts (s1) ;
strncat (s1,s2,n) ;
puts ("Result of strncat( ) - ") ;
puts (s1) ;

puts ("Set String 1 - ") ;
strnset (s1,c,n) ;
puts (s1) ;
puts ("String 2 - ") ;
puts (s2) ;
n=4;
m = strncmp (s2,s1,n) ;
puts ("Result of strncmp( ) - ") ;
cout<<m ;
getch ( ) ;
}

Example 127 : Program to illustrates External Storage Classes
#include<iostream.h>
int i ;
//External variable
void decre( );
void incre( ) ;
void main( )
{
cout << "\n i = "<<i ;
incre( );
incre( );
decre( );
decre( );
}
void incre( )
{
i = i + 1;
cout << "\n On incrementing i = " << i ;
}
void decre( )
{
i = i - 1;
cout << "\n On decrementing i = " << i ;
}

Example 128 : Program to illustrates String
#include <iostream.h>
#include <conio.h>
void main( )
{
char str[ ] = "Hello";
int i = 0;
while (i<=4)
{
cout << str[i];
i++;
}
getch( );
}

Example 129 : Program to illustrates String
#include <iostream.h>
#include <conio.h>
void main( )
{
char str[ ] = "Hello";
int i = 0;
while (str[i]!='###BOT_TEXT###')
{
cout << str[i];
i++;
}
getch( );
}

Example 130 : Program to illustrates String
#include <iostream.h>
#include <conio.h>
void main( )
{
char str[ ] = "Hello";
char *ptr ;
ptr = str;
//store base address of string
while (*ptr !='###BOT_TEXT###')
{
cout << *ptr;
ptr++;
}
getch( );
}

Example 131 : Program to illustrates String
#include <iostream.h>
#include <conio.h>
void main( )
{
char str[] = "Hello";
cout<<str;
getch( );
}

Example 132 : Program to illustrates String
#include <iostream.h>
#include <conio.h>
void main( )
{
char str[20] ;
cout<<"\n Enter any string :";
cin>>str;
cout<<"\n The string is :"<<str;
getch( );
}

Example 133 : Program to illustrates gets( ) & puts( ) function
#include <iostream.h>
#include <conio.h>
#include<stdio.h>
void main( )
{
char str[20] ;
cout << "\n Enter any string :" ;
gets(str);
puts( " The string is : " ) ;
puts(str) ;
getch( );
}
/*
Output:
Enter any string : Hello
The string is :
Hello
*/

Example 134 : Program to calculate Length of String
#include <iostream.h>
#include <conio.h>
#include<stdio.h>
char line[40] ;
int calculate_length ( ) ;
void main ()
{
int length ;
cout <<" Enter a string : " ;
gets(line) ;
length = calculate_length ( ) ;
cout<<" \nThe string length is "<<length ;
getch ( ) ;
}
int calculate_length ( )

{
int count = 0 ;
while (line[count] != '###BOT_TEXT###')
count++ ;
return (count) ;
}
Example 135 : Program to Copy a String
#include <iostream.h>
#include <conio.h>
#include<stdio.h>
void main ( )
{
int i ;
char sentence[40] , copy[40] ;
cout<<"Enter any string :" ;
gets (sentence) ;
i=0;
for (i=0 ; i<40 ; i++)
copy[i] = 0 ;
i=0;
while (sentence[i] != '###BOT_TEXT###')
{
copy[i] = sentence[i] ;
i++ ;
}
cout<<"\nThe copied string is : " ;
puts (copy) ;
getch ( ) ;
}
Example 136 : Program to perform Concatenation of Strings
#include <iostream.h>
#include <conio.h>
#include<stdio.h>
void concatenate (char str1[40],char str2[40]) ;
void main ()
{
char str1[60] , str2[40] ;
puts ("Enter the first string :") ;
gets (str1) ;
puts ("\nEnter the second string :") ;

gets (str2) ;
concatenate (str1,str2) ;
puts ("\nThe concatenated string is :") ;
puts (str1) ;
getch ( ) ;
}
void concatenate (char str1[40], char str2[40])
{
int i, j;
i=0;
while (str1[i] != '###BOT_TEXT###')
i++ ;
str1[i] = ' ' ;
i++ ;
j=0;
while (str2[j] != '###BOT_TEXT###')
{
str1[i] = str2[j] ;
i++ ;
j++ ;
}
}

Example 137 : Program to perform Comparisons of Two Strings
#include <iostream.h>
#include <conio.h>
#include<stdio.h>
int compare (int i,char str1[],char str2[]);
void main ( )
{
int i , j , count = 0 ;
char str1[40],str2[40] ;
for (i=0 ; i<40 ; i++)
{
str1[i] = '###BOT_TEXT###' ;
str2[i] = '###BOT_TEXT###' ;
}
puts ("Enter the first string :") ;
gets (str1);
puts ("\nEnter the second string :") ;
gets (str2);
count = compare (i,str1,str2);

if ( (str1[count] == '###BOT_TEXT###')&&(str2[count]=='###BOT_TEXT###'))
puts ("\nThe two strings are equal.") ;
else
puts ("\nThe two strings are unequal.") ;
getch ( ) ;
}
int compare (int i,char str1[],char str2[])
{
i=0;
while ((str1[i]==str2[i])&&(str1[i]!='###BOT_TEXT###')&&(str2!='###BOT_TEXT###'))
++i ;
return (i) ;
}

Example 138 : Program to perform Reversal of String
#include <iostream.h>
#include <conio.h>
#include<stdio.h>
void main ( )
{
int count , i ;
char line[40] , reverse[40] ;
puts ("Enter A String - ") ;
gets (line) ;
count = 0 ;
while (line[count] != '###BOT_TEXT###')
count++ ;
count-- ;
for(i=0 ; i<40 ; i++)
reverse[i] = 0 ;
i=0;
while (count >= 0)
{
reverse[count] = line[i] ;
count-- ;
i++ ;
}
puts ("\nThe reversed string is - ") ;
puts (reverse) ;
getch ( ) ;
}

Example 139 : Program to illustrate Difference between Call by Value & Call by
Reference
#include <iostream.h>
#include <conio.h>
void f (int, int &);
void main( )
{
int a = 22, b = 44;
cout<<" a = "<<a <<",
f(a,b);
cout<<" a = "<<a <<",
f(2*a-3,b);
cout<<" a = "<<a <<",
getch();
}
void f(int x, int *y)
{
x = 88;
* y = 99;
}

b = " <<b<<endl;
b = " <<b<<endl;
b = " <<b<<endl;

","doc_promotions_enabled":false,"static_promo_banner_cta_url":""},"eligible_for_exclusive_trial_roadblock":false,"eligible_for_seo_roadblock":false,"exclusive_free_trial_roadblock_props_path":"/doc-page/exclusive-free-trial-props/259260323","flashes":[],"footer_props":{"urls":{"about":"/about","press":"/press","blog":"http://literally.scribd.com/","careers":"/careers","contact":"/contact","plans_landing":"/subscribe","referrals":"/referrals?source=footer","giftcards":"/giftcards","faq":"/faq","accessibility":"/accessibility-policy","faq_paths":{"accounts":"https://support.scribd.com/hc/sections/202246346","announcements":"https://support.scribd.com/hc/sections/202246066","copyright":"https://support.scribd.com/hc/sections/202246086","downloading":"https://support.scribd.com/hc/articles/210135046","publishing":"https://support.scribd.com/hc/sections/202246366","reading":"https://support.scribd.com/hc/sections/202246406","selling":"https://support.scribd.com/hc/sections/202246326","store":"https://support.scribd.com/hc/sections/202246306","status":"https://support.scribd.com/hc/en-us/articles/360001202872","terms":"https://support.scribd.com/hc/sections/202246126","writing":"https://support.scribd.com/hc/sections/202246366","adchoices":"https://support.scribd.com/hc/articles/210129366","paid_features":"https://support.scribd.com/hc/sections/202246306","failed_uploads":"https://support.scribd.com/hc/en-us/articles/210134586-Troubleshooting-uploads-and-conversions","copyright_infringement":"https://support.scribd.com/hc/en-us/articles/210128946-DMCA-copyright-infringement-takedown-notification-policy","end_user_license":"https://support.scribd.com/hc/en-us/articles/210129486","terms_of_use":"https://support.scribd.com/hc/en-us/articles/210129326-General-Terms-of-Use"},"publishers":"/publishers","static_terms":"/terms","static_privacy":"/privacy","copyright":"/copyright","ios_app":"https://itunes.apple.com/us/app/scribd-worlds-largest-online/id542557212?mt=8&uo=4&at=11lGEE","android_app":"https://play.google.com/store/apps/details?id=com.scribd.app.reader0&hl=en","books":"/books","sitemap":"/directory"}},"global_nav_props":{"header_props":{"logo_src":"/images/landing/home2_landing/scribd_logo_horiz_small.svg","root_url":"https://www.scribd.com/","search_term":"","small_logo_src":"/images/logos/scribd_s_logo.png","uploads_url":"/upload-document","search_props":{"redirect_to_app":true,"search_url":"/search","query":"","search_page":false}},"user_menu_props":null,"sidebar_props":{"urls":{"bestsellers":"https://www.scribd.com/bestsellers","home":"https://www.scribd.com/","saved":"/saved","subscribe":"/archive/pmp_checkout?doc=259260323&metadata=%7B%22context%22%3A%22pmp%22%2C%22action%22%3A%22start_trial%22%2C%22logged_in%22%3Afalse%2C%22platform%22%3A%22web%22%7D","top_charts":"/bestsellers","upload":"https://www.scribd.com/upload-document"},"categories":{"book":{"icon":"icon-ic_book","icon_filled":"icon-ic_book_fill","url":"https://www.scribd.com/books","name":"Books","type":"book"},"news":{"icon":"icon-ic_articles","icon_filled":"icon-ic_articles_fill","url":"https://www.scribd.com/news","name":"News","type":"news"},"audiobook":{"icon":"icon-ic_audiobook","icon_filled":"icon-ic_audiobook_fill","url":"https://www.scribd.com/audiobooks","name":"Audiobooks","type":"audiobook"},"magazine":{"icon":"icon-ic_magazine","icon_filled":"icon-ic_magazine_fill","url":"https://www.scribd.com/magazines","name":"Magazines","type":"magazine"},"document":{"icon":"icon-ic_document","icon_filled":"icon-ic_document_fill","url":"https://www.scribd.com/docs","name":"Documents","type":"document"},"sheet_music":{"icon":"icon-ic_songbook","icon_filled":"icon-ic_songbook_fill","url":"https://www.scribd.com/sheetmusic","name":"Sheet Music","type":"sheet_music"}},"categories_array":["mixed","book","audiobook","magazine","news","document","sheet_music"],"selected_content_type":"mixed","username":"","search_overlay_props":{"search_input_props":{"focused":false,"keep_suggestions_on_blur":false}}}},"recommenders":{"related_titles_recommender":{"ids":[45835321,155667897,17089700,350888182,212305227,54143133,268725533,55019446,96425172,251379649,101603679,355880592,138187657,364047559,326675206,312122740,304927883,125980492,386563452,360039683,312220086,249294292,49009837,106637925,339715759,349275135,115723933,309593917,82552386,356677834,259260359,362117325,259259865,259259846,259260343,259259874,360789082,375985967,259260328,259260351,264758934,360788919,362117305,259260335,259259828,259259765,259005858,259259788,259005826,259005813,259259797,259005805,259005809,259005862,259259821,259005817,259005790,259005799,259005852],"title_link":null,"title":null,"track_opts":{"compilation_id":"8M+WEm/TTwTbwrkuL0eDU8to6Qk=","module_id":"mSBZErnVoxLKusVJ+7Lua1pk6EA=","widget_name":"right sidebar","track_id":"flattened_recommender"}},"footer_recommenders":{"recommenders":[{"ids":[45835321,155667897,17089700,350888182,212305227,54143133,268725533,55019446,96425172,251379649,101603679,355880592,138187657,364047559,326675206,312122740,304927883,125980492,386563452,360039683,312220086,249294292,49009837,106637925,339715759,349275135,115723933,309593917,82552386,356677834],"title_link":null,"title":"Documents Similar To Object Oriented Programming Constructors and Destructors ","track_opts":{"compilation_id":"8M+WEm/TTwTbwrkuL0eDU8to6Qk=","module_id":"LSiyk1yUzxhGGlGBpPSIy7bXmCQ=","widget_name":"document_carousel"}},{"ids":[259260359,362117325,259259865,259259846,259260343,259259874,360789082,375985967,259260328,259260351,264758934,360788919,362117305,259260335,259259828,259259765,259005858,259259788,259005826,259005813,259259797,259005805,259005809,259005862,259259821,259005817,259005790,259005799,259005852],"title_link":null,"title":"More From Jaikumar Guwalani","track_opts":{"compilation_id":"8M+WEm/TTwTbwrkuL0eDU8to6Qk=","module_id":"AjQDsAzUmxgI5HvCDxSuRgyurww=","widget_name":"document_carousel"}}]},"seo_new_docs_recommenders":{"recommenders":[]},"documents":{"17089700":{"type":"document","id":17089700,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/17089700/108x144/9d2000fba0/1246662301?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/17089700/216x288/87767ad34d/1246662301?v=1","title":"Chapter6","short_title":"Chapter6","author":"sedimbi","tracking":{"object_type":"document","object_id":17089700,"track":"flattened_recommender","doc_uuid":"Qik198LzRT9zRszbvMS2ZWTXKrs="},"url":"https://www.scribd.com/document/17089700/Chapter6"},"45835321":{"type":"document","id":45835321,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/45835321/108x144/08543c6139/1487181179?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/45835321/216x288/7619e78e9b/1487181179?v=1","title":"Aspiring Minds Model Paper Solved","short_title":"Aspiring Minds Model Paper Solved","author":"Hamsa Dharishani","tracking":{"object_type":"document","object_id":45835321,"track":"flattened_recommender","doc_uuid":"8LOUwzydZ6g91Dj5ytrZb3vcvl4="},"url":"https://www.scribd.com/doc/45835321/Aspiring-Minds-Model-Paper-Solved"},"49009837":{"type":"document","id":49009837,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/49009837/108x144/7582620aed/1352641545?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/49009837/216x288/0d33ed5e8d/1352641545?v=1","title":"C_Lessons_by_Chris_Sawtell","short_title":"C_Lessons_by_Chris_Sawtell","author":"g_teodorescu","tracking":{"object_type":"document","object_id":49009837,"track":"flattened_recommender","doc_uuid":"ysAICArPYf0Xssg9C6HgsR+et9E="},"url":"https://www.scribd.com/document/49009837/C-Lessons-by-Chris-Sawtell"},"54143133":{"type":"document","id":54143133,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/54143133/108x144/b142c18c92/1304007334?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/54143133/216x288/3ad8bf1a12/1304007334?v=1","title":"Assignment","short_title":"Assignment","author":"Basireddy Girish","tracking":{"object_type":"document","object_id":54143133,"track":"flattened_recommender","doc_uuid":"jlvwIwqCTkT5/eyIInfkoL8+ba4="},"url":"https://www.scribd.com/document/54143133/Assignment"},"55019446":{"type":"document","id":55019446,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/55019446/108x144/0420afafc2/1369164355?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/55019446/216x288/21ec228ff2/1369164355?v=1","title":"c Program_test Your Self","short_title":"c Program_test Your Self","author":"govindh2so4479","tracking":{"object_type":"document","object_id":55019446,"track":"flattened_recommender","doc_uuid":"D+6fyExzBGBaaVONSTBx1/aa7w0="},"url":"https://www.scribd.com/doc/55019446/c-Program-test-Your-Self"},"82552386":{"type":"document","id":82552386,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/82552386/108x144/8442f213fc/1330000072?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/82552386/216x288/4240f94e5d/1330000072?v=1","title":"Transaction Flows","short_title":"Transaction Flows","author":"Ram Chandru","tracking":{"object_type":"document","object_id":82552386,"track":"flattened_recommender","doc_uuid":"6lLxVcmehBzGi4xdoDDy4e2Ax7s="},"url":"https://www.scribd.com/document/82552386/Transaction-Flows"},"96425172":{"type":"document","id":96425172,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/96425172/108x144/d3cb439696/1383115006?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/96425172/216x288/d46b88e00b/1383115006?v=1","title":"More Information About Balloon Shooting Game_presentation","short_title":"More Information About Balloon Shooting Game_presentation","author":"Bhagawati Narayan","tracking":{"object_type":"document","object_id":96425172,"track":"flattened_recommender","doc_uuid":"LSIVmB+G7ssCkMYS5L/uznfexoY="},"url":"https://www.scribd.com/presentation/96425172/More-Information-About-Balloon-Shooting-Game-presentation"},"101603679":{"type":"document","id":101603679,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/101603679/108x144/822abe6053/1343710311?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/101603679/216x288/752666a065/1343710311?v=1","title":"esc101-lec20","short_title":"esc101-lec20","author":"Mukesh Kumar Dewra","tracking":{"object_type":"document","object_id":101603679,"track":"flattened_recommender","doc_uuid":"TWs6Tk+UFC741X6LKzL8YkvfEE4="},"url":"https://www.scribd.com/document/101603679/esc101-lec20"},"106637925":{"type":"document","id":106637925,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/106637925/108x144/184c4acfa2/1361355032?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/106637925/216x288/f89ae27a10/1361355032?v=1","title":"Pascal Program","short_title":"Pascal Program","author":"Gaby Mbugua","tracking":{"object_type":"document","object_id":106637925,"track":"flattened_recommender","doc_uuid":"6Y4xboOGIlu0q/TOpD/iRJdtjkg="},"url":"https://www.scribd.com/document/106637925/Pascal-Program"},"115723933":{"type":"document","id":115723933,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/115723933/108x144/2451c7df37/1354774593?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/115723933/216x288/870e890350/1354774593?v=1","title":"How to Face Technical Interviews","short_title":"How to Face Technical Interviews","author":"Krishna Chaitanya","tracking":{"object_type":"document","object_id":115723933,"track":"flattened_recommender","doc_uuid":"mcH+MS9qUeJQQMr/zmBvh5Gifm8="},"url":"https://www.scribd.com/document/115723933/How-to-Face-Technical-Interviews"},"125980492":{"type":"document","id":125980492,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/125980492/108x144/635a7e83e8/1361167449?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/125980492/216x288/8572f8d96e/1361167449?v=1","title":"Java Record[1]","short_title":"Java Record[1]","author":"Naveen Kumar","tracking":{"object_type":"document","object_id":125980492,"track":"flattened_recommender","doc_uuid":"Ttepzs25tB660wywPo+Isi8Xj+M="},"url":"https://www.scribd.com/document/125980492/Java-Record-1"},"138187657":{"type":"document","id":138187657,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/138187657/108x144/2ac50070df/1399011931?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/138187657/216x288/a1a268820f/1399011931?v=1","title":"C++ Interview Questions","short_title":"C++ Interview Questions","author":"Rajesh Paul","tracking":{"object_type":"document","object_id":138187657,"track":"flattened_recommender","doc_uuid":"txLCG4I5y4IN+13oMIuka6ozLFQ="},"url":"https://www.scribd.com/document/138187657/C-Interview-Questions"},"155667897":{"type":"document","id":155667897,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/155667897/108x144/10ada7efa9/1374666836?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/155667897/216x288/16da378197/1374666836?v=1","title":"Computer Practical File","short_title":"Computer Practical File","author":"Ravinder Singh","tracking":{"object_type":"document","object_id":155667897,"track":"flattened_recommender","doc_uuid":"uI4t3ozZad4bsSJrXFtX+YYIl7I="},"url":"https://www.scribd.com/document/155667897/Computer-Practical-File"},"212305227":{"type":"document","id":212305227,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/212305227/108x144/b41ffa0fdb/1394734142?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/212305227/216x288/4330295efe/1394734142?v=1","title":"C Interview Questions","short_title":"C Interview Questions","author":"Eleonor Camargo","tracking":{"object_type":"document","object_id":212305227,"track":"flattened_recommender","doc_uuid":"xkJqcuewMloaZNfqp/Pb2s9aF/E="},"url":"https://www.scribd.com/document/212305227/C-Interview-Questions"},"249294292":{"type":"document","id":249294292,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/249294292/108x144/940afa35f2/1417815034?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/249294292/216x288/1908360f35/1417815034?v=1","title":"Pascal","short_title":"Pascal","author":"King Clevon","tracking":{"object_type":"document","object_id":249294292,"track":"flattened_recommender","doc_uuid":"9YdOruVaLhtyg26IdwEErzH2ZCI="},"url":"https://www.scribd.com/document/249294292/Pascal"},"251379649":{"type":"document","id":251379649,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/251379649/108x144/1a8c8d2355/1420020426?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/251379649/216x288/14eab88c53/1420020426?v=1","title":"Cpp-collected Lab Manual","short_title":"Cpp-collected Lab Manual","author":"Galatu Basha","tracking":{"object_type":"document","object_id":251379649,"track":"flattened_recommender","doc_uuid":"P+kT4ToBlxiUJaFZm7pc5lsIySE="},"url":"https://www.scribd.com/document/251379649/Cpp-collected-Lab-Manual"},"259005790":{"type":"document","id":259005790,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/259005790/108x144/af82bf554c/1426584745?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/259005790/216x288/253d1fcd06/1426584745?v=1","title":"SCHEME - G Fourth Semester (CH)","short_title":"SCHEME - G Fourth Semester (CH)","author":"Jaikumar Guwalani","tracking":{"object_type":"document","object_id":259005790,"track":"flattened_recommender","doc_uuid":"CQKlut+VTsNph0bNuQtao0BjgLA="},"url":"https://www.scribd.com/document/259005790/SCHEME-G-Fourth-Semester-CH"},"259005799":{"type":"document","id":259005799,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/259005799/108x144/7101496529/1426584739?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/259005799/216x288/9772b839ab/1426584739?v=1","title":"Scheme - g Fourth Semester (Co,Cm,CD,If, Cw)","short_title":"Scheme - g Fourth Semester (Co,Cm,CD,If, Cw)","author":"Jaikumar Guwalani","tracking":{"object_type":"document","object_id":259005799,"track":"flattened_recommender","doc_uuid":"sm/IpYP8mp9km+IavxkAz+Cbdyc="},"url":"https://www.scribd.com/doc/259005799/Scheme-g-Fourth-Semester-Co-Cm-CD-If-Cw"},"259005805":{"type":"document","id":259005805,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/259005805/108x144/e80c3009e1/1426584734?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/259005805/216x288/1d9442698b/1426584734?v=1","title":"SCHEME - G Fourth Semester (de)","short_title":"SCHEME - G Fourth Semester (de)","author":"Jaikumar Guwalani","tracking":{"object_type":"document","object_id":259005805,"track":"flattened_recommender","doc_uuid":"UZyQB0sI/ob3QzZ/ZY4VlanhKbw="},"url":"https://www.scribd.com/document/259005805/SCHEME-G-Fourth-Semester-de"},"259005809":{"type":"document","id":259005809,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/259005809/108x144/05bfeeded9/1426584730?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/259005809/216x288/f6ec474de5/1426584730?v=1","title":"Scheme - g Fourth Semester (Ee,Ep)","short_title":"Scheme - g Fourth Semester (Ee,Ep)","author":"Jaikumar Guwalani","tracking":{"object_type":"document","object_id":259005809,"track":"flattened_recommender","doc_uuid":"NmnpuOa9Reh+Pj8ph+fBnPVUAbw="},"url":"https://www.scribd.com/document/259005809/Scheme-g-Fourth-Semester-Ee-Ep"},"259005813":{"type":"document","id":259005813,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/259005813/108x144/4d57cfc801/1426584727?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/259005813/216x288/602d093c54/1426584727?v=1","title":"Scheme - g Fourth Semester (Ej, Et, Ex, En, Is, Ic, Ed, Ei)","short_title":"Scheme - g Fourth Semester (Ej, Et, Ex, En, Is, Ic, Ed, Ei)","author":"Jaikumar Guwalani","tracking":{"object_type":"document","object_id":259005813,"track":"flattened_recommender","doc_uuid":"hdPYUPzdFHMo9uCRqPspDdvaNX4="},"url":"https://www.scribd.com/document/259005813/Scheme-g-Fourth-Semester-Ej-Et-Ex-En-Is-Ic-Ed-Ei"},"259005817":{"type":"document","id":259005817,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/259005817/108x144/1f13dd49ba/1426584723?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/259005817/216x288/5047c8f103/1426584723?v=1","title":"SCHEME - G Fourth Semester (EV)","short_title":"SCHEME - G Fourth Semester (EV)","author":"Jaikumar Guwalani","tracking":{"object_type":"document","object_id":259005817,"track":"flattened_recommender","doc_uuid":"kYlh+63JSXUsMPqAt37YvIJAKM4="},"url":"https://www.scribd.com/doc/259005817/SCHEME-G-Fourth-Semester-EV"},"259005826":{"type":"document","id":259005826,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/259005826/108x144/35de3e2212/1426584717?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/259005826/216x288/f8e7e85717/1426584717?v=1","title":"SCHEME - G Fourth Semester (if)","short_title":"SCHEME - G Fourth Semester (if)","author":"Jaikumar Guwalani","tracking":{"object_type":"document","object_id":259005826,"track":"flattened_recommender","doc_uuid":"Y+tdkWgsA0jlTTFQWizNmHj+QTY="},"url":"https://www.scribd.com/document/259005826/SCHEME-G-Fourth-Semester-if"},"259005852":{"type":"document","id":259005852,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/259005852/108x144/037cceca0d/1426584701?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/259005852/216x288/c704da3654/1426584701?v=1","title":"SCHEME - G Fourth Semester (ME)","short_title":"SCHEME - G Fourth Semester (ME)","author":"Jaikumar Guwalani","tracking":{"object_type":"document","object_id":259005852,"track":"flattened_recommender","doc_uuid":"qxN1XGnytU+KWFuGFhq73ulVYWc="},"url":"https://www.scribd.com/document/259005852/SCHEME-G-Fourth-Semester-ME"},"259005858":{"type":"document","id":259005858,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/259005858/108x144/fcfeec464d/1426584607?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/259005858/216x288/1616868893/1426584607?v=1","title":"SCHEME - G Fourth Semester (MU)","short_title":"SCHEME - G Fourth Semester (MU)","author":"Jaikumar Guwalani","tracking":{"object_type":"document","object_id":259005858,"track":"flattened_recommender","doc_uuid":"Zp1CLLVC/tKxDHuvnmaxKxsQZC8="},"url":"https://www.scribd.com/doc/259005858/SCHEME-G-Fourth-Semester-MU"},"259005862":{"type":"document","id":259005862,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/259005862/108x144/3cb927121b/1426584470?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/259005862/216x288/49562007df/1426584470?v=1","title":"Scheme - g Fourth Semester (Pg,Pt)","short_title":"Scheme - g Fourth Semester (Pg,Pt)","author":"Jaikumar Guwalani","tracking":{"object_type":"document","object_id":259005862,"track":"flattened_recommender","doc_uuid":"EYo3ofa4wmyEhpZgMGti3tUOhU4="},"url":"https://www.scribd.com/doc/259005862/Scheme-g-Fourth-Semester-Pg-Pt"},"259259765":{"type":"document","id":259259765,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/259259765/108x144/a59df4a588/1426763087?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/259259765/216x288/5756db34bf/1426763087?v=1","title":"Chapter-1-Object Oriented Programming","short_title":"Chapter-1-Object Oriented Programming","author":"Jaikumar Guwalani","tracking":{"object_type":"document","object_id":259259765,"track":"flattened_recommender","doc_uuid":"KpUgGxdwFQwe1hJRRoyjgCiMG4c="},"url":"https://www.scribd.com/document/259259765/Chapter-1-Object-Oriented-Programming"},"259259788":{"type":"document","id":259259788,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/259259788/108x144/a994043526/1426763127?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/259259788/216x288/23f3d57f54/1426763127?v=1","title":"Chapter 2 Objects and Classes","short_title":"Chapter 2 Objects and Classes","author":"Jaikumar Guwalani","tracking":{"object_type":"document","object_id":259259788,"track":"flattened_recommender","doc_uuid":"7fNUtati1RRxHs5ecYWtseV4jYg="},"url":"https://www.scribd.com/document/259259788/Chapter-2-Objects-and-Classes"},"259259797":{"type":"document","id":259259797,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/259259797/108x144/8851631c8e/1426763164?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/259259797/216x288/33afae9126/1426763164?v=1","title":"Chapter 3 Constructors and Desctructors","short_title":"Chapter 3 Constructors and Desctructors","author":"Jaikumar Guwalani","tracking":{"object_type":"document","object_id":259259797,"track":"flattened_recommender","doc_uuid":"ky1ukHQEFX7woNGvtE7k4/Vxfn8="},"url":"https://www.scribd.com/document/259259797/Chapter-3-Constructors-and-Desctructors"},"259259821":{"type":"document","id":259259821,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/259259821/108x144/cfa1279dfc/1426763195?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/259259821/216x288/8b3d22f348/1426763195?v=1","title":"Chapter 4 Inheritance","short_title":"Chapter 4 Inheritance","author":"Jaikumar Guwalani","tracking":{"object_type":"document","object_id":259259821,"track":"flattened_recommender","doc_uuid":"epbM8mXMdmXXkGBWTJ2eSfliZoY="},"url":"https://www.scribd.com/document/259259821/Chapter-4-Inheritance"},"259259828":{"type":"document","id":259259828,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/259259828/108x144/5d0b35070c/1426763237?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/259259828/216x288/e6f5f181bc/1426763237?v=1","title":"Chapter-5-Pointer in C++","short_title":"Chapter-5-Pointer in C++","author":"Jaikumar Guwalani","tracking":{"object_type":"document","object_id":259259828,"track":"flattened_recommender","doc_uuid":"+FHbsY3dedjUcwdiG9zJJkn/L8s="},"url":"https://www.scribd.com/document/259259828/Chapter-5-Pointer-in-C"},"259259846":{"type":"document","id":259259846,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/259259846/108x144/92858e13e0/1426763294?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/259259846/216x288/153353fa92/1426763294?v=1","title":"Chapter 6 Polymorphism","short_title":"Chapter 6 Polymorphism","author":"Jaikumar Guwalani","tracking":{"object_type":"document","object_id":259259846,"track":"flattened_recommender","doc_uuid":"G57D76GK9D7/ImDDhKk5GoE4NBY="},"url":"https://www.scribd.com/document/259259846/Chapter-6-Polymorphism"},"259259865":{"type":"document","id":259259865,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/259259865/108x144/3be720077b/1426763338?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/259259865/216x288/3794832d0a/1426763338?v=1","title":"Chapter-7-Basic Function of IO System Basics & File Processing","short_title":"Chapter-7-Basic Function of IO System Basics & File Processing","author":"Jaikumar Guwalani","tracking":{"object_type":"document","object_id":259259865,"track":"flattened_recommender","doc_uuid":"PXspxY1NVPGSDqu8mfmgSJjBuaM="},"url":"https://www.scribd.com/document/259259865/Chapter-7-Basic-Function-of-IO-System-Basics-File-Processing"},"259259874":{"type":"document","id":259259874,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/259259874/108x144/58e20e77f9/1426763449?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/259259874/216x288/c359fa7fd2/1426763449?v=1","title":"Sample Question Paper _Object Oriented Programming-12063","short_title":"Sample Question Paper _Object Oriented Programming-12063","author":"Jaikumar Guwalani","tracking":{"object_type":"document","object_id":259259874,"track":"flattened_recommender","doc_uuid":"h6zRz6ZC3Owr/an8oeasbzKClgg="},"url":"https://www.scribd.com/doc/259259874/Sample-Question-Paper-Object-Oriented-Programming-12063"},"259260328":{"type":"document","id":259260328,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/259260328/108x144/2f77ec8773/1426764646?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/259260328/216x288/43d963cc1e/1426764646?v=1","title":"Object Oriented Programming Inheritance","short_title":"Object Oriented Programming Inheritance","author":"Jaikumar Guwalani","tracking":{"object_type":"document","object_id":259260328,"track":"flattened_recommender","doc_uuid":"Du9aZXLYncvvusyG2Nm3xTFxaKo="},"url":"https://www.scribd.com/document/259260328/Object-Oriented-Programming-Inheritance"},"259260335":{"type":"document","id":259260335,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/259260335/108x144/3e4151f09e/1431538073?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/259260335/216x288/c46de2e440/1431538073?v=1","title":"Object Oriented Programming Pointer in c++","short_title":"Object Oriented Programming Pointer in c++","author":"Jaikumar Guwalani","tracking":{"object_type":"document","object_id":259260335,"track":"flattened_recommender","doc_uuid":"AXSEFjNMfuadNFEszH3NmzVtQk0="},"url":"https://www.scribd.com/document/259260335/Object-Oriented-Programming-Pointer-in-c"},"259260343":{"type":"document","id":259260343,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/259260343/108x144/babc4c0b91/1426764959?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/259260343/216x288/747e6feb4a/1426764959?v=1","title":"Object Oriented Programming Polymorphism","short_title":"Object Oriented Programming Polymorphism","author":"Jaikumar Guwalani","tracking":{"object_type":"document","object_id":259260343,"track":"flattened_recommender","doc_uuid":"afVJFFOW9bvQoq2eTqX2wEw9b08="},"url":"https://www.scribd.com/document/259260343/Object-Oriented-Programming-Polymorphism"},"259260351":{"type":"document","id":259260351,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/259260351/108x144/d5a22f0387/1461416727?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/259260351/216x288/9f57e3cce7/1461416727?v=1","title":"Object Oriented Programming Chapter 1","short_title":"Object Oriented Programming Chapter 1","author":"Jaikumar Guwalani","tracking":{"object_type":"document","object_id":259260351,"track":"flattened_recommender","doc_uuid":"mMfGutfFC0ntSNJabz5UhXmRqs4="},"url":"https://www.scribd.com/document/259260351/Object-Oriented-Programming-Chapter-1"},"259260359":{"type":"document","id":259260359,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/259260359/108x144/beb5f63245/1426763632?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/259260359/216x288/e670c22da0/1426763632?v=1","title":"OOP Objects and Classes programs ","short_title":"OOP Objects and Classes programs ","author":"Jaikumar Guwalani","tracking":{"object_type":"document","object_id":259260359,"track":"flattened_recommender","doc_uuid":"ZYJGY3IdaQ0AxtXJkjj0T1klNyo="},"url":"https://www.scribd.com/document/259260359/OOP-Objects-and-Classes-programs"},"264758934":{"type":"document","id":264758934,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/264758934/108x144/bb0a468183/1431197654?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/264758934/216x288/13d8cf04e7/1431197654?v=1","title":"Operating System W14 answer paper","short_title":"Operating System W14 answer paper","author":"Jaikumar Guwalani","tracking":{"object_type":"document","object_id":264758934,"track":"flattened_recommender","doc_uuid":"WYlHz/tNwwquo/GqQZO2UAB1txA="},"url":"https://www.scribd.com/document/264758934/Operating-System-W14-answer-paper"},"268725533":{"type":"document","id":268725533,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/268725533/108x144/9959bad530/1477582417?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/268725533/216x288/44f37f22ca/1477582417?v=1","title":"Maventic placement paper","short_title":"Maventic placement paper","author":"Sujay Menasinkai","tracking":{"object_type":"document","object_id":268725533,"track":"flattened_recommender","doc_uuid":"XqG6mS7KV4GwhMLLZfsFCYdUR/E="},"url":"https://www.scribd.com/document/268725533/Maventic-placement-paper"},"304927883":{"type":"document","id":304927883,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/304927883/108x144/d8770dfaa6/1458099452?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/304927883/216x288/9aff82c9b0/1458099452?v=1","title":"Hee","short_title":"Hee","author":"Worse To Worst Satittamajitra","tracking":{"object_type":"document","object_id":304927883,"track":"flattened_recommender","doc_uuid":"M0P60KJAubM1hpigSc9JnNIJq9I="},"url":"https://www.scribd.com/document/304927883/Hee"},"309593917":{"type":"document","id":309593917,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/309593917/108x144/ba150913ff/1460998905?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/309593917/216x288/141289783d/1460998905?v=1","title":"t14BCharactersAndStringFunctions.pps","short_title":"t14BCharactersAndStringFunctions.pps","author":"Anjali Naidu","tracking":{"object_type":"document","object_id":309593917,"track":"flattened_recommender","doc_uuid":"qsAfgjLO9jfjCZPyKbF3e4VEK7o="},"url":"https://www.scribd.com/document/309593917/t14BCharactersAndStringFunctions-pps"},"312122740":{"type":"document","id":312122740,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/312122740/108x144/802eb7c65c/1462889702?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/312122740/216x288/d59573140b/1462889702?v=1","title":"Mphasis Placement Paper","short_title":"Mphasis Placement Paper","author":"nagasaikiran","tracking":{"object_type":"document","object_id":312122740,"track":"flattened_recommender","doc_uuid":"pElkNpkatupD9AWVokEu4qRzKH4="},"url":"https://www.scribd.com/document/312122740/Mphasis-Placement-Paper"},"312220086":{"type":"document","id":312220086,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/312220086/108x144/59fd2ef138/1462956168?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/312220086/216x288/2ab0437156/1462956168?v=1","title":"Chapter 4. Class and Object","short_title":"Chapter 4. Class and Object","author":"minhquangel","tracking":{"object_type":"document","object_id":312220086,"track":"flattened_recommender","doc_uuid":"z/btbjtcL9kz+ItE/TkbleWuxVg="},"url":"https://www.scribd.com/document/312220086/Chapter-4-Class-and-Object"},"326675206":{"type":"document","id":326675206,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/326675206/108x144/a4edcb05f1/1475784639?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/326675206/216x288/e238279927/1475784639?v=1","title":"2E3_big3","short_title":"2E3_big3","author":"davidsmith24026","tracking":{"object_type":"document","object_id":326675206,"track":"flattened_recommender","doc_uuid":"63DfWXUEI10O2TRhPuniPlqb6L8="},"url":"https://www.scribd.com/document/326675206/2E3-big3"},"339715759":{"type":"document","id":339715759,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/339715759/108x144/5e58d18ff9/1487494775?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/339715759/216x288/bdaa629225/1487494775?v=1","title":"C Programming Homework Help - Coding the Game Labyrinth","short_title":"C Programming Homework Help - Coding the Game Labyrinth","author":"Steve Smith","tracking":{"object_type":"document","object_id":339715759,"track":"flattened_recommender","doc_uuid":"9HiPlmjKZX6F9nklPYSOhzYjI7Y="},"url":"https://www.scribd.com/document/339715759/C-Programming-Homework-Help-Coding-the-Game-Labyrinth"},"349275135":{"type":"document","id":349275135,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/349275135/108x144/589b3644ac/1495600460?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/349275135/216x288/8692bb01cf/1495600460?v=1","title":"Commands-Axe-Parser.pdf","short_title":"Commands-Axe-Parser.pdf","author":"n70","tracking":{"object_type":"document","object_id":349275135,"track":"flattened_recommender","doc_uuid":"OMDgGpoQcSs0JkKDKQz2PvNb9eE="},"url":"https://www.scribd.com/document/349275135/Commands-Axe-Parser-pdf"},"350888182":{"type":"document","id":350888182,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/350888182/108x144/56ed5a90cf/1497142802?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/350888182/216x288/11ee363986/1497142802?v=1","title":"Pointers..","short_title":"Pointers..","author":"gana","tracking":{"object_type":"document","object_id":350888182,"track":"flattened_recommender","doc_uuid":"whneN30Qchay2DoUOx0MSfcaZtw="},"url":"https://www.scribd.com/presentation/350888182/Pointers"},"355880592":{"type":"document","id":355880592,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/355880592/108x144/2377a97f37/1502347662?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/355880592/216x288/8f427290e0/1502347662?v=1","title":"170_Copy_Constructor_Assignment_Operator.pdf","short_title":"170_Copy_Constructor_Assignment_Operator.pdf","author":"vishal_pshetti","tracking":{"object_type":"document","object_id":355880592,"track":"flattened_recommender","doc_uuid":"K/lrzgGpswDVZC/7lrXo76mYG00="},"url":"https://www.scribd.com/document/355880592/170-Copy-Constructor-Assignment-Operator-pdf"},"356677834":{"type":"document","id":356677834,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/356677834/108x144/634b781555/1503273326?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/356677834/216x288/3a23517375/1503273326?v=1","title":"EEEB114 Worksheet 8 v1 0.pdf","short_title":"EEEB114 Worksheet 8 v1 0.pdf","author":"abdullah badawi","tracking":{"object_type":"document","object_id":356677834,"track":"flattened_recommender","doc_uuid":"n+YSsFztIw/jvuTneMVORm6081s="},"url":"https://www.scribd.com/document/356677834/EEEB114-Worksheet-8-v1-0-pdf"},"360039683":{"type":"document","id":360039683,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/360039683/108x144/2e58b1a68d/1507072762?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/360039683/216x288/bac4f48645/1507072762?v=1","title":"C++ Vs Java.pdf","short_title":"C++ Vs Java.pdf","author":"Affan Ahmed","tracking":{"object_type":"document","object_id":360039683,"track":"flattened_recommender","doc_uuid":"RQRznlDV9SOk6vL6thA4Hys81Yw="},"url":"https://www.scribd.com/document/360039683/C-Vs-Java-pdf"},"360788919":{"type":"document","id":360788919,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/360788919/108x144/e64a2c0916/1507222974?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/360788919/216x288/2ebcf1cd79/1507222974?v=1","title":"Deadlocks Final","short_title":"Deadlocks Final","author":"Jaikumar Guwalani","tracking":{"object_type":"document","object_id":360788919,"track":"flattened_recommender","doc_uuid":"16qcmGRRq63NNHMY9Ku6+fIOXFQ="},"url":"https://www.scribd.com/presentation/360788919/Deadlocks-Final"},"360789082":{"type":"document","id":360789082,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/360789082/108x144/30d0700626/1507223071?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/360789082/216x288/01b57dad41/1507223071?v=1","title":"Unix Case Study","short_title":"Unix Case Study","author":"Jaikumar Guwalani","tracking":{"object_type":"document","object_id":360789082,"track":"flattened_recommender","doc_uuid":"XXyIPtxa4i11cCDNg/hL7aDdpuA="},"url":"https://www.scribd.com/presentation/360789082/Unix-Case-Study"},"362117305":{"type":"document","id":362117305,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/362117305/108x144/f179f61ae5/1508500457?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/362117305/216x288/c8e0c265e9/1508500457?v=1","title":"ch4.pdf","short_title":"ch4.pdf","author":"Jaikumar Guwalani","tracking":{"object_type":"document","object_id":362117305,"track":"flattened_recommender","doc_uuid":"6pvqKmdxezpZljr9LPnrLwRJ6Hg="},"url":"https://www.scribd.com/document/362117305/ch4-pdf"},"362117325":{"type":"document","id":362117325,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/362117325/108x144/599849bb00/1508500479?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/362117325/216x288/a2146aaf33/1508500479?v=1","title":"patanjali-products.pdf","short_title":"patanjali-products.pdf","author":"Jaikumar Guwalani","tracking":{"object_type":"document","object_id":362117325,"track":"flattened_recommender","doc_uuid":"zMRDE9p+ZZLx4NVnxjgrJjZZMWE="},"url":"https://www.scribd.com/document/362117325/patanjali-products-pdf"},"364047559":{"type":"document","id":364047559,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/364047559/108x144/35d59e0be4/1510319631?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/364047559/216x288/6f3f1a6df1/1510319631?v=1","title":"07PassingPointers.pdf","short_title":"07PassingPointers.pdf","author":"haine12345","tracking":{"object_type":"document","object_id":364047559,"track":"flattened_recommender","doc_uuid":"56DUt7joL7LcPcR41mbAKFq0Yw8="},"url":"https://www.scribd.com/document/364047559/07PassingPointers-pdf"},"375985967":{"type":"document","id":375985967,"thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/375985967/108x144/c9374a3e2a/1523356766?v=1","retina_thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/375985967/216x288/de84932752/1523356766?v=1","title":"First n Follow","short_title":"First n Follow","author":"Jaikumar Guwalani","tracking":{"object_type":"document","object_id":375985967,"track":"flattened_recommender","doc_uuid":"U1LhSSSscfcyS57T+uGG346t7QE="},"url":"https://www.scribd.com/document/375985967/First-n-Follow"},"386563452":{"type":"document","id":386563452,"thumb_url":"https://imgv2-1-f.scribdassets.com/img/document/386563452/108x144/d5b69f3ab1/1534710279?v=1","retina_thumb_url":"https://imgv2-2-f.scribdassets.com/img/document/386563452/216x288/34013f4bc7/1534710279?v=1","title":"Codes Ys","short_title":"Codes Ys","author":"khaldoun sami","tracking":{"object_type":"document","object_id":386563452,"track":"flattened_recommender","doc_uuid":"pxUkEsssL21WvOGtn96tNhGx/KE="},"url":"https://www.scribd.com/document/386563452/Codes-Ys"}}},"seo_roadblock_props_path":"/doc-page/seo-roadblock-props/259260323","signup_context":null,"toolbar":{"search_path":"/search-4gen?allowed_pages=&auth_token=HOXlPKHfpIJzoHl52YYRCom3xh0%3D&authenticity_token=%2BF5yanGEBJNiMrJDVbgW3Vkc%2BioxGOHW3Q41Wha9qhcGPiBEOTFXd%2Bt3iHAer77BlIHwJ8wJ5qeUPtQW5Rn%2FOQ%3D%3D&expires=1538221731&wordDocumentId=259260323&wordUploadId=264020988"},"renewal_nag_props":null}-->