C++ Tutorials

C++ Program For Implementation of Pointers 0

C++ Program For Implementation of Pointers

Program 1 // Program for Pointer demo #include<iostream> #define clrscr() system(“cls”) using namespace std; int main() { /* Pointer Part 1 */ //int a=50,*p,**r; //clrscr(); // p=&a; // r=&p; // cout<<” \nValue of a:...

C++ Program for Default Arguments in Function 0

C++ Program for Default Arguments in Function

Program 1 // Default arguament in function #include<iostream> #define clrscr() system(“cls”) using namespace std; int add(int a,int b=100,int c); int main() { clrscr(); int result; // Three Argument result=add(10,10,10); cout<<“\nAddition is”<<result; // Two Arguement...

C++ Menu Driven Program 0

C++ Menu Driven Program

Program 1 // Menu driven application #include<iostream> #define clrscr() system(“cls”) using namespace std; void addition(); void reverse(); void palindrom(); void armstrong(); void getdata(); int n,r,s=0; int main() { int choice; clrscr(); do { cout<<“\n—————-Menu——————-“;...

C++ Program For Call by Value and Return by Value 0

C++ Program For Call by Value and Return by Value

Program 1 // Function declaration and definition #include<iostream> #define clrscr() system(“cls”) using namespace std; int add(int a,int b); int main() { clrscr(); int a,b,c; cout<<“Enter two number”; cin>>a>>b; c=add(a,b); //call by value cout<<“Additon is...

C++ Program For Local and Global Variable 0

C++ Program For Local and Global Variable

Program 1 // Function local and global variables #include<iostream> #define clrscr() system(“cls”) using namespace std; int a=500; //void display(); int main() { // Outer clrscr(); int a=30; { int a=10; // Inner cout<< “Inner”<<a;...

C++ Program to Print Corner Elements of Matrix 0

C++ Program to Print Corner Elements of Matrix

Program 1 // Print corner elements #include<iostream> #define clrscr() system(“cls”) using namespace std; int main() { int a[50][50],r,c,m,n; clrscr(); xyz: cout<<“\nEnter the value row and column\n”; cin>>m>>n; if(m>50 || n>50) { cout<<“\n Invalid limit\n”;...

C++ Program to Multiply Two Matrices 0

C++ Program to Multiply Two Matrices

Program 1 // Multiplication of Two Matrix #include<iostream> #define clrscr() system(“cls”) using namespace std; int main() { int a[50][50],b[50][50],c1[50][50],r,c,k,m,n; clrscr(); xyz:cout<<“\nEnter value of row and column\n”; cin>>m>>n; if(m>50 || n>50) { cout<<“\n Invalid limit...

C++ Program to Print Upper and Lower Triangle of Matrix 0

C++ Program to Print Upper and Lower Triangle of Matrix

Program 1 // Program for Lower Triangle elements of matrix #include<iostream> #define clrscr() system(“cls”) using namespace std; int main() { int a[50][50],r,c,m,n; clrscr(); xyz:cout<<“\n Enter value of row and column”; cin>>m>>n; if(m>50 || n>50)...

C++ Program to Print the Diagonals of a Matrix 0

C++ Program to Print the Diagonals of a Matrix

Program 1 // Program for digonal elements of matrix #include<iostream> #define clrscr() system(“cls”) using namespace std; int main() { int a[50][50],r,c,m,n; clrscr(); xyz:cout<<“\n Enter value of row and column”; cin>>m>>n; if(m>50 || n>50) {...