Data Types in C++

 Data Types in C++


These are the User Defined Data Types in C++

  • INT Stores whole Numbers Like 80
  • Char stores character like"D"
  • Double For Floating Numbers Like "8.20"
  • String For Storing Text Like "Aban"
  • Bool Sores value For state Like"True or False"

#include<iostream>

using namespace std;

int main()

{

double a=10.12;

char letter='D';

int x=20;

string myName="Aban";

bool expression=true;

    cout << letter << endl;

    cout << a << endl;

    cout << x <<endl;

    cout << myName <<endl;

    cout << expression <<endl;


    return 0;

}


Endl is used For line Break




No comments

Powered by Blogger.