Skip to main content

Posts

Showing posts from February 17, 2012

C++ Programs (object oriented programming)

1. WAP for digital clock. #include<conio.h> #include<iostream.h> #include<dos.h> void main() {     int s=0,m=0,h=0,i;     clrscr();     for(i=1;i<=3600;i++)     {         s++;         if(s==60)         {             m++;             s=0;         }         if(m==60)         {             h++;             m=0;         }         textbackground(WHITE);         textcolor(YELLOW);         delay(5);         clrscr();         cprintf("%d::%d::%d",h,m,s)         ;     }     getch(); } 2. WAP for matrix multiplication. #include<conio.h> #include<iostream.h> void main() {     int a[3][3],b[3][3],c[3][3],i,j,k;     clrscr();     cout<<"Enter The 9 number of Matrix a:\n";     for(i=0;i<=2;i++)     {         for(j=0;j<=2;j++)         {             cin>>a[i][j];         }     }     cout<<"Enter The 9 number of Matrix b:\n";     for(i=0;i<=2;i++)     {         for(j=0;j<=2;j++)         {             cin