0% found this document useful (0 votes)
25 views

C++ Data Types

this is data type

Uploaded by

salman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

C++ Data Types

this is data type

Uploaded by

salman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Basic Data Types

Data Type Size Description

boolean 1 byte Stores true or false values

char 1 byte Stores a single character/letter/number, or ASCII values

int 2 or 4 bytes Stores whole numbers, without decimals

float 4 bytes Stores fractional numbers, containing one or more decimals. Sufficient for
storing 6-7 decimal digits

double 8 bytes Stores fractional numbers, containing one or more decimals. Sufficient for
storing 15 decimal digits
How to solve Square root in C++
#include <iostream>
#include <cmath>
using namespace std;

int main() {cout << "Square root of 25 = ";


cout << sqrt(25);
return 0;
}
How to solve Square in C++
#include<iostream>
#include <math.h>
using namespace std;
int main()
{ float E,m,c;
cout << "enter the value of mass in Kg=";
cin >> m;
cout << "enter the value of speed in m/s=";
cin >> c;
E=m*c*c;
cout << "the energy in J is =" << E;
return 0;
How to solve exponent in C++
#include <iostream>
#include <cmath>
using namespace std;
int main () {
long double base = 5.5;
int exponent = 6;
long double result1 = pow(base, exponent);
cout << result1 << endl;
return 0;
}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy