Public: string nicname; string nomi; int age;}; int main { inson Obj1; Ob name = "Dilshod\n"; Ob burj = "Arslon\n"


Download 397.42 Kb.
Sana11.05.2023
Hajmi397.42 Kb.
#1451851
Bog'liq
Dasturlash.pdf






#include
using namespace std;
class inson {
public:
string name;
string burj;
int age;};
class hayvon {
public:
string nicname;
string nomi;
int age;};
int main() {
inson Obj1;
Obj1.name = "Dilshod\n";
Obj1.burj = "Arslon\n";
Obj1.age = 17;
hayvon Obj2;
Obj2.nicname = "Stuart\n";
Obj2.nomi = "ot\n";
Obj2.age = 2;
cout <<"Name:"<< Obj1.name <<" Burj:" << Obj1.burj <<" Age:" << Obj1.age<< "\n";
cout <<"Nomi:"<return 0;}



#include
#include
using namespace std;

class kub{


int V, S;
public:
kub(int a)
{ V = a*a*a;
S = 4 * a *a;
cout<<"V="<kub(string s)
{ cout << "Kubning tomoni 6 ta tomoni " << s;
cout<<"Kubning qirrasi: 12 ta"<cout<<"Kubning 6 ta yoqi mavjud"<cout<<"Kubning uchi:8ta"<int main(){ int a;string s;
cout<<"a=";cin>>a;
kub Obj(a);kub Obj1 (s);
return 0;}

Download 397.42 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling