/*Aim: PC to PC Communication using RS-232 in 'C'. */ #include #include #define COM1 0 #define DATA_READY 0x100 #define SETTINGS ( 0x80 | 0x02 | 0x00 | 0x00) int main(void) { int in, out, status; bioscom(0, SETTINGS, COM1); /*initialize the port*/ cprintf("Data sent to you: "); while (1) { status = bioscom(3, 0, COM1); /*wait until get a data*/ if (status & DATA_READY) if ((out = bioscom(2, 0, COM1) & 0x7F) != 0) /*input a data... Read Full Story
/* C++ program on Computer Details */ #include< iostream.h> #include< conio.h> #define max 80 int y; int a = 0; int b = 0; long c = 0; int d,m,p; class computer { private: char s[10],x[10],h[10]; public: void getdata() { cout< < "Enter Computer Type : "; cin>>h; cout< < endl; cout< < "Enter CPU Type : "; cin>>x; cout< < endl; cout< < "Enter The Type Of OS : "; cin>>s; cout< < endl; cout< < "Enter The Memory In MB : "; cin>>m; cout< < endl; cout< < "Enter The... Read Full Story
/********* IMPLEMENTATION OF MULTILEVEL INHERITANCE *********/ #include< iostream.h> #include< conio.h> class student // Base Class { protected: int rollno; char *name; public: void getdata(int b,char *n) { rollno = b; name = n; } void putdata(void) { cout< < " The Name Of Student \t: "< < name< < endl; cout< < " The Roll No. Is \t: "< < rollno< < endl; } }; class test:public student // Derieved Class 1... Read Full Story
/**** C Program For Implementation Of Bubble Sort. Sorting names entered by the user *****/ #include< stdio.h> #include< conio.h> #define MAX 10 char name[MAX][15]; void sort(int n) { int pa,cp,i,j,k,kk=0; char temp[15]; pa=n-1; cp=n-1; for(i=1;i< =pa;i++) { for(j=1;j< =cp;j++) { kk=kk+1; if(strcmp(name[j],name[j+1])>0) { strcpy(temp,name[j]); strcpy(name[j],name[j+1]); strcpy(name[j+1],temp); } } printf("\n List after %d pass is ",i); for(k=1;k< =n;k... Read Full Story