DEV Community

Charos1mm
Charos1mm

Posted on • Updated on

C++ga kirish

Biz bugun C++ darsida ishlashni organdik.Replit.comesa qanday foydalanishni bilib oldik unda kamentlarni kodlashni organib oldik.

  /*cout << "Salom guruhdegilar\n";
 cout << "salom nima "<<end ;
  cout << "salom nima ";*/


Enter fullscreen mode Exit fullscreen mode

Replit.comdan C++dan foydalanish
#include <iostream> biz foydalanmoqchi bolgan kutubxonamiza.
using namespace std;bundan esa hadib std:: cout ishlatmaslig ucun foydalandik.
RUNdan esa qanday qilib ekranga ciqarib olishnin bilib oldik.

Biz c++dan yana kop narsalarni o'rgandik.
C++dan O'zgaruvchilar turlarni organdik

adata tip nom=qiymat;

-------------Ozgaruvchilar turlari---------------
   int=>integer ya'ni faqat butun son saqlaydi;4byte  
  string=>faqat tekstlar saqlash ucun;4byte
  char=>faqat 1ta belgi saqlash ucun;1byte
 float=>faqat kasr son saqlash ucun;4byte
*/

 int yosh =17;
string ism =" Charos";

  cout<<" Salom"<<ism<<endl;
  cout<<"men"<<yosh<<" daman";
  return 0;
}

Enter fullscreen mode Exit fullscreen mode


cpp
*C++ * kopaytirish,qoshishni,ayirishni organdik

int main4(){
 int son,son1,son2;
  son1=10;
  son2=son1+20;
  son=son1+son2;

  cout<< son << endl; //40

  son=son*3;
  cout<< son<<endl;
  string ism,a,b,c;
  ism=" Charos";
  a="Salom";
  b=" Nima gap";

  cout <<a<<ism<<b<<endl;

  b="Qalaysan";
  cout<<b;
return 0;
Enter fullscreen mode Exit fullscreen mode
`int main6(){
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<<"="<<`
Enter fullscreen mode Exit fullscreen mode

BU ko'paytirish

@dawroun

Top comments (0)