Character pointer array Get link Facebook X Pinterest Email Other Apps January 04, 2021 //array of char pointer#include<iostream.h>int main(int argc, char *argv[]){char* p[]={"sun","mon","tue","wed"};for(int i=0;i<4;i++)cout<<p[i]<<endl;} Get link Facebook X Pinterest Email Other Apps Comments
Pointer to object array January 07, 2021 #include<iostream.h> using namespace std; class name{ private: char nm[20]; public: void get() {cout<<"Enter name:"; cin>>nm; } void show() {cout<<nm<<endl; } }; int main(int argc, char *argv[]) { name* p[100]; char c; int n=0; do{ p[n]->get(); cout<<"mire name:"; cin>>c; }while(c=='y'); do{ p[n]->show(); }while(n>=0); return 0; } Read more
Inductance caculator December 25, 2020 #include<iostream.h> #include<math.h> #include<conio.h> using namespace std; unsigned short int bit; double c,l,fre,rad,Tmax,Tmin=0.5e-6; unsigned short int res; double ind(double); int main(int argc, char *argv[]) { cout<<"INDUCTANCE METER CACULATOR\n"; cout<<"**************************\n"; cout<<"8MHZ Fosc is used \nTcyc= 0.5e-6 sec\n "; cout<<"Select timer mode.\n"; cout<<"for 8 bit mode enter 8\nfor 16 bit mode enter 16\nbit:"; cin>>bit; res=pow(2,bit)-1; Tmax=res*Tmin; cout<<"\nResolution="<<res; std::cout<<std::scientific; cout<<"\nTmin="<<Tmin<<" s"; cout<<"\nTmax="<<Tmax<<" s"; cout<<"\nEnter ref cap(farad):"; cin>>c; cout<<"\n\nYou Entered"<<endl; //cout<<"L="<<l<<endl; cout<<"C="<... Read more
Comments
Post a Comment