DEV Community

Abror_7
Abror_7

Posted on

C++

C++
ko'dalarni o'z ichiga oladi

replit yordamida ko'dlarni yozamiz
Masalan;

#include <iostream>
#include <iomanip>
using namespace std;
int main() {
int eni, boyi;
  cout << "Area is ";
  cin >> eni >> boyi;
  cout << setprecision(2) << fixed << eni * boyi << (".") ;
return 0;
}
Enter fullscreen mode Exit fullscreen mode

#include <iostream> bu kutubxona .
bu kutubxonada bizga kerakli bo'lgan buyrular mavjud.
Masalan;

std

std shu ko'rinishda ishlatilinadi

 std :: cout << "salom do'stlar";
Enter fullscreen mode Exit fullscreen mode

std buyrug'ini ishlatmasa ham buyruq bersa bo'ladi uning nomi
using namespace std ;

#include <iostream>
using namespace std;

int main() {

 cout << "Hala Madrid";

  return 0;

}
Enter fullscreen mode Exit fullscreen mode

int main (){}shu ko'rinishda bo'ladi.
int main- main so'zi "Asosiy funksiya" degani hamma ko'dlarni buni ichiga yozamiz


int main() {

 cout << 4-5 ;

Enter fullscreen mode Exit fullscreen mode

replit da hamma so'lar qo'shtirnoq ichida yoziladi.

#include <iostream>
using namespace std;

int main() {

 cout << "bugun og'ir kun bo'ldi";

  return 0;

}
Enter fullscreen mode Exit fullscreen mode

data tip nom - qiymat ya'ni o'zgaruvchilarning turlari
uning ichiga
int ya'ni faqat butun son saqlaydi


int a = 45 ;
 cout << 50 - a ;

  return 0;

}
Enter fullscreen mode Exit fullscreen mode

string faqat textlar uchun .

#include <iostream>
using namespace std;

int main() {


string a = "Abror" ;
 cout << "Salom " << a ;

  return 0;

}
Enter fullscreen mode Exit fullscreen mode

char faqat bitta belgi saqlash uchun .
float faqat kasr sonlar uchun.

@dawroun

Top comments (1)

Collapse
 
dawroun profile image
Davron

vashe zor