Ma'lumot turlari

nuriddin152

Nuriddin152

Posted on March 10, 2023

Ma'lumot turlari

Data Type - Ma'lumot turlari:

#include <iostream>
using namespace  std;

int main()
{

int num = 123;                   //Butun sonlar uchin
float numq = 15.23;              // kasr sonlar uchun
double num3 = 95.6123;           //o'nli kasr sonlar uchun
char letter = "B";               //Belgilar uchun
bool Boolean = True "or" False;  //to'g'ri yoki noto'g'ri
string text = "Hello World";     //Tekst uchun


return 0;
}
Enter fullscreen mode Exit fullscreen mode

Ma'lumotlarni asosiy turlari

Image description

Raqamlar uchun - int - integer - faqat raqamlar va solar uchun ishlatiladi

#include <iostream>
using namespace std;

int main()
{

int num = 10;
int num1 = 130;
int num2 = 4560;

return 0;
}
Enter fullscreen mode Exit fullscreen mode

Kasr sonlar - float faqat kasr sonllar uchun ishlatiladi;

#include <iostream>
using namespace std;

int main()
{

float num = 123.54;
float num1 = 12.548;
float num2 = 153.855;
float num3 = 4556.544;


return 0;
}
Enter fullscreen mode Exit fullscreen mode

double - faqat kasr sonlar uchun ishlatiladi

#include <iostream>
using namespace std;

int main()
{

double num = 1.55815;
double num1 = 2.65454;

return 0;
}
Enter fullscreen mode Exit fullscreen mode

Farqai float nuqtadan keyin 4 ta son bo'ladi double nuqtadan keyin 8 ta son bo'ladi

#include <iostream>
using namwspace std;

int main()
{

float = 1.2315;
duoble num1 = 1.12345678;

return 0;
}
Enter fullscreen mode Exit fullscreen mode

String
string bu faqat matn va tekst turlari uchun ishlatiladi

#inlude <iostream>
using namespace std;

int main()
{

cout << "Men hozir Cpp ni o'rganyapman va Cpp juda qizik ekan";

return 0;
}
Enter fullscreen mode Exit fullscreen mode

char - beldilar uchun;
char - ma'lumotlar turi saqlash uchun foydalanadigan yagona belgi. Belgilar 'A', yoki 'c' kabi bir tirnoq bilan o'ralgan bolishi kerak

#include <iostream>
using namespase std;

int main()
{

char sing = "A";
char sing1 = "B";
char sing2 = "c";

cout << sing << endl;
cout << sing1 << endl;
cout << sing;

return 0;
}
Enter fullscreen mode Exit fullscreen mode

boolean ma'lumotlar turi bilan e'lon qilinadi bool kalit so'z va faqat qiymatlarni qabul qilishi mumkin true yoki false.Qiymat qaytarilganda true = 1 va false = 0

#include <iostream>
using namespace std;

int main()
{

bool true = 25;
bool true1 = 35;

cout << true =< true1; // bu to'gri `true`
cout << true1 =< true; // bu noto'g'ri

return 0;
}
Enter fullscreen mode Exit fullscreen mode
💖 💪 🙅 🚩
nuriddin152
Nuriddin152

Posted on March 10, 2023

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

setw() va setfill()
cpp setw() va setfill()

November 1, 2024

Variables & Data types
cpp Variables & Data types

October 29, 2024

Dasturlash
cpp Dasturlash

October 29, 2024

Conditional operator.
cpp Conditional operator.

October 31, 2024