Neeraj Mishra

A crazy computer and programming lover. He spend most of his time in programming, blogging and helping other programming geeks.

C++ program to print the following design:

#include<iostream.h>#include<conio.h>void main(){ clrscr(); //to clear the screen int i,j,k,n;  cout<<“How many lines?”; cin>>n;  n*=2; for(i=0;i<n;i+=2) { cout<<“n”; for(j=1;j<i;j+=2) cout<<” “; for(k=n-1;k>i;–k) cout<<“*”; } getch(); //to stop the screen}

C++ program to create a loading bar

#include<iostream.h> #include<conio.h> #include<graphics.h> #include<dos.h> void main() { int x=170,i,gdriver=DETECT,gmode; initgraph(&gdriver,&gmode,”c:\tc\bgi”); settextstyle(DEFAULT_FONT,HORIZ_DIR,2); outtextxy(170,180,”LOADING,PLEASE WAIT”); for(i=0;i<300;++i) { delay(30); line(x,200,x,220); x++; } getch(); closegraph(); }

C++ Matrix Multiplication Program

Here you will get C++ matrix multiplication program. What we are doing in this program. Read number of rows and columns for two matrix. Then check if matrix multiplication is possible or not. If not possible then show a message to user otherwise multiply them. Finally display the result. C++ Matrix Multiplication Program   Output