পোস্টগুলি

ফেব্রুয়ারী, ২০২০ থেকে পোস্টগুলি দেখানো হচ্ছে

Big number summation(UVA 495)

ছবি
code: #include<iostream> #define size 10000 using namespace std; int max_fibo=0; string fibo_n[5001]; string big_sum(string s1,string s2){     int l1,l2,carry=0;     int sum,i=0;     char result[size],ch;     for(l1=0;s1[l1]!='\0';l1++);     for(l2=0;s2[l2]!='\0';l2++);     for(l1--,l2--;l1>=0;l1--,l2--){         if(l2>=0){             sum=(s1[l1]-'0')+(s2[l2]-'0')+carry;         }else sum=(s1[l1]-'0')+carry;         carry=sum/10;         result[i++]=(sum%10)+'0';     }if(carry) result[i++]=carry+'0';     result[i]='\0';     for(l2=0;result[l2]!='\0';l2++);     l1=0;     for(l2--;l1<l2;l2--,l1++){   ...

Inherited constructor and distructor

ছবি
code: #include<iostream> using namespace std; class information{ protected:     string name;     int id;     string address;     double salary; public:     information(){         cout<<"Information default constractor called."<<endl;         name="Not entered.";         id=-1;         address="Not found.";         salary=0.0;     }information(string name,int id,string address,double salary){         this->name=name;         this->id=id;         this->address=address;         this->salary=salary;     }     ~information(){ ...