/*
data tip non=qiymat;
---------O'zgaruvchilar turlari---------
int=>integer ya'ni faqat butun son saqlaydi;4 byte
string=>faqat tekislar saqlash uchun;4 byte
char=>faqat bitta belgi saqlash uchun;1 byte
float=>faqat kasr son saqlash uchun;4 byte
*/
int yosh=16;
string ism= "Etibor";
cout<<"salom "<< ism <<endl;
cout<<"man "<< yosh<< "yoshman";
return 0;
}
Biz bu kodda butun sonlarni ekaranga chiqarishmi organamiz.
#include <iostream>
using namespace std;
int main1() {
cout<<"salom ikkichilar\n";
cout<<"mani yoshim" <<" 16 da"<< endl;
cout<<"25+5"<< endl;
cout<<25*5;
cout<<"ota"<<" ona\n";
cout<<25+5;
return 0;
}
Bu kodda siz cin "siaut"ni ishlatishni organasiz.
int son;
cout<<"sanni kiriting:";
cin>>son;
cout<<"siz kiritgan son:"<< son;
return 0;
}
BU kodda sonlarni bir qatorga chiqarishni o'rganamiz.SHu bilan birgalikda matinlarni ham.
int son,son1,son2;
son1=10;
son2=son1+20;
son=son1+son2;
cout<<son<< endl;
son=son*3;
cout<<son<<endl;
string ism,a,b,c;
ism="Etibor";
a="salom ";
b=" nima gap";
cout<<a<<ism<<b<<endl;
b="qolaysan";
cout<<b;
return 0;
}
Bu kodda esa masalalar ishlashmiz mumkin.cin
yordamida.
int m;
cin>> m;
cout<<m<<m<<m<<m<<m<<m<<endl;
cout<<m<<" "<<m<< endl;
cout<<m<<" "<<m<< endl;
cout<<m<<m<<m<<m<<m<<m;
return 0;
}
Bu kodda esa karajadval ishlashni organamiz.
int son;
cin >> son;
cout << son << "*" << 1 << "=" << son*1 <<endl;
cout<< son <<"*" << 2 << "=" << son*2 <<endl;
cout<< son <<"*" << 3 << "=" << son*3 <<endl;
cout<< son <<"*" << 4 << "="<< son*4 <<endl;
cout<<son <<"*" << 5 <<"=" <<son*5 <<endl;
cout<<son <<"*" << 6 <<"=" <<son*6 <<endl;
cout<<son <<"*" << 7 <<"=" <<son*7 <<endl;
cout<<son <<"*" << 8 <<"=" <<son*8 <<endl;
cout<<son <<"*" << 9 <<"=" <<son*9 ;
return 0;
}
Top comments (0)