C++ 4 classes
// Online C++ compiler to run C++ program online
#include <iostream>
// #include<string> // many compilers need string to be imported to work with string
using namespace std;
int main() {
// Write C++ code here
// std::cout << "Start small. Ship something.";
/*
int a=12;
float b=3.14;
double c=12.34l;
char d='A';
bool bol=false;
string s="Gunjan Nayak";
cout<<a<<endl;
cout<<b<<endl;
cout<<c<<endl;
cout<<d<<endl;
cout<<bol<<endl;
cout<<s<<endl;*/
// cout<<(d<<endl;
// int c=12;
// double d=c;
// cout<<d<<endl;
// double r=12.34;
// cout<<r<<endl;
// int s=(int)r;
// cout<<s<<endl;
// signed int a=-12;
// cout<<a<<endl;
// unsigned int a=-12;
// cout<<a<<endl;
// int a=12;
// cout<<sizeof(a)<<endl;
// short int c=12;
// short c=12;
// cout<<sizeof(c)<<endl;
// long int a=12;
// long a=12;
// long long int a=12; // 8 bytes
// long long a=12;
// cout<<sizeof(a)<<endl;
// const int a=12;
volatile int a=12;
a=23;
cout<<a<<endl;
return 0;
}
Comments
Post a Comment