Logo Facebook8    Logo Youtube12    Logo Google     Logo twitter

Lectia 3 C++ | Tipuri de date

Orice variabila sau constanta este de un anumit tip de date.

Tipurile de date sunt:
- char
- int
- float
- bool

Acum, sa definim fiecare tip de date.

Incepem cu tipul de date "char":
Acest tip de date, lucreaza doar cu caractere.
Caracterele sunt: A, b, C, d, etc.

EXEMPLU:

#include <iostream>
#include <stdio.h>
using namespace std;

int main(){

char a='T'; //valoarea lui a, este T

printf("%c",a); //se afiseaza valoarea lui A, care este T
return 0;}

 

 
Urmeaza tipul de date "int":
Acest tip de date, lucreaza doar cu numere intregi.
In int putem pune numere de la -32766 pana la 32767.
Pentru numere mai mari, s-a creat un calificator "long".

EXEMPLU:

 

#include <iostream>
#include <stdio.h>
using namespace std;

int main(){

int x=500;
long long int y=5000000000; //am folosit calificatorul long pentru numere mai mari

cout << x; //se afiseaza valoarea lui x
printf("\n"); //rand nou
cout << y; //se afiseaza valoarea lui y

return 0;}

500
5000000000 

 


In final, urmeaza tipul de date "float":
Acest tip de date, lucreaza cu numere care contin virgula.
Virgula se noteaza cu punct (.).
Float poate sa contina maxim 7 cifre.
Pentru a marii numarul de cifre se foloseste "double" in loc de "float".

EXEMPLU:

 

#include <iostream>
#include <stdio.h>
using namespace std;

int main(){

float x=1.234567891;
printf("%f\n",x); //vor aparea 7 cifre pe ecran, chiar daca noi avem 10

double y=1.23456789128;
printf("%.11f",y); //"%.11f" acest .11` indica aparitia a 11 numere dupa virgula
//daca punem .15, vor aparea 15 numere
//se pune intre "%" si "f"

return 0;}

1.234567891
1.23456789128

Acest site foloseste cookie-uri.

Folosim cookie-uri pentru a vă asigura că aveti cea mai bună experiență pe acest site.

I understand
DESPRE NOI
World-IT este un site care are ca domeniu Tehnologia Informatiei(IT).
Acest site are ca prim scop introducerea persoanelor in acest domeniu. Mai multe informatii aici.

URMARESTE-NE 
Logo Facebook8  Logo Youtube12   Logo Google  Logo twitter

Sitemap | Despre noi

cialiscialis couponcialis genericcialis dosagegeneric cialiscialis costcialis vs viagracialis pricescialis side effectscialis couponscialis 30 day sampleviagra vs cialiscialis onlinecialis pillscialis samplesbuy cialiscialis 20 mgcialis patent expirationcialis coupons printablecialis for daily usecialis samples overnightcheap cialiscost of cialis200 cialis couponcialis dailycialis 20mggeneric cialis at walmartcealiscialis canadacialis trialhow does cialis workwhen will cialis go genericcialis on lineside effects of cialiscialis 30 day trial couponcialis 5mgcialis for mencialasbuy cialis onlinecialis for salecialis patent expiration date extendedhow to take cialiscialis pricecialis from canadahow much does cialis costfree cialisviagra vs cialis vs levitracialis reviewscialis coupons from manufacturerwhat is cialiscialis pills for salecialis patent expiration 2017canadian cialiscialis tadalafilcialis or viagrageneric for cialiscialis professionalcialis free trialcialis medicationciliascialis for bphcialis coupons 2017cyaliscialis dosage strengthscialis discountgeneric cialis tadalafildiscount cialiscialis dosage recommendationscialis 5 mgonline cialiscialis canadian pharmacycialis copay cardlowest cialis pricescialis for womencialis generic availabilitycialis vouchercialis savings cardcialis 10 mgcialis websitecialis generic tadalafilliquid cialisdaily cialisviagra cialiscialis otcerectile dysfunction cialiscialis 5mg dailycanada cialiscialis coupon 20 mgcialis pricingcialis coupon printviamedic cialiscialis cheapcialis pharmacy pricescialis 20mg directionsprice cialiscialis samplewholesale cialiscialis alternativecialis effectscialis testimonialslevitralevitra couponlevitra 20 mglevitra 20mgbuy levitralevitra priceslevitra genericlevitra onlinelevitra vs viagrageneric levitralevitra couponslevitra rezeptfrei deutschlandlevitra 10 mg prezzocheap levitra9 levitra at walmartlevitra erfahrungenlevitra dosageviagra vs cialis vs levitrageneric levitra vardenafil 20mgwhat works better than viagrabuy levitra onlinelevitra without a doctor prescriptionbuy generic levitralevitra 20mg cost per pillvardenafil 20mglevitra prezzo in farmacialevitra 20 mg precio farmaciavardenafil vs viagralevitra 20 mg cost walmartlevitra vs viagra for hardnesslevitra bayer 20mg meilleur prixlevitra 20 mg von bayerviagrageneric viagraviagra genericviagra couponsviagra without a doctor prescriptionviagra onlineequipe argentine viagraviagra pricesbuy viagracialis vs viagracheap viagraviagra pillsviagra samplesviagra side effectswhat is viagraviagra couponviagra naturalviagra dosageviagra for sale uknatural viagrabuy viagra onlinegeneric viagra 100mgfemale viagrahow does viagra workhow to use viagraviagra activateherbal viagraviagra tabletssophia viagraviagra sans ordonnanceviagra kaufenviagra tabletviagra vs cialisonline viagracanadian viagraviagra for womenviagra ohne rezept aus deutschlandpfizer viagraviagra 100mgviagra costfree viagraviagra alternativesviagra canadaviagra on lineviagra single packsviagra for menviagra pillviagra 100mg tablets retail priceorder viagraviagra tescoside effects of viagraviagra pillen kruidvatviagra for salediscount viagrawhat does viagra doviagra costsviagra uklevitra vs viagrawhere to buy viagraviagra substitutehow long does viagra lastviagra alternativeviagra receptfrittviagra priceviagra 100viagra en ligne livraison 24hviagra on line no precviagra 100 mgutilisation viagrabest price viagracost of viagraviagra sexviagra wikipediasex viagra for womenviagra nebenwirkungenrevatio vs viagraviagra without a doctor prescription usaviagra genericoviagra 50mgviagra from canadaover the counter viagraviagra effectsviagra medicinepfizer viagra coupons from pfizerbuy generic viagraviagra wikiviagra bestellenviagra ohne rezept auf rechnungcanada viagrawomen viagrabuying viagraviagra soft