C++ Tutorials

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 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) {...

C++ Program for Matrix 0

C++ Program for Matrix

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

C++ Program to Delete an Element From an Array 0

C++ Program to Delete an Element From an Array

Program 1 //Program for remove element from array; #include<iostream> #define clrscr() system(“cls”) using namespace std; int main() { int a[50],n,i,idx; clrscr(); input:cout<<“\nEnter the limit: “; cin>>n; if(n>50) { cout<<“\n Invalid limit pls enter again”;...

C++ Program to Convert Decimal to Octal 0

C++ Program to Convert Decimal to Octal

Program 1 // Decimal to Octal Conversion #include<iostream> #define clrscr() system(“cls”) using namespace std; int main() { int d,oct[100],i,r; clrscr(); cout<<“\nEnter decimal number”; cin>>d; i=0; //Conversion of decimal to octal while(d!=0) { r=d%8; oct[i]=r;...

C++ Program to Convert Decimal to Hexadecimal 0

C++ Program to Convert Decimal to Hexadecimal

Program 1 // Decimal to Hexadecimal conversion #include<iostream> #define clrscr() system(“cls”) using namespace std; int main() { int d,hexa[100],i,r; clrscr(); cout<<“\nEnter decimal number”; cin>>d; i=0; while(d!=0) { r=d%16; hexa[i]=r; d=d/16; i++; } i–; while(i>=0)...