




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























































































OOPS Concept Definitions
#include <iostream.h> using namespace std; int main() { cout << "Hello this is C++"; }
char a = 'A'; // character type int a = 1; // integer type float a = 3.14159; // floating point type double a = 6e-4; // double type (e is for exponential)
enum day(mon, tues, wed, thurs, fri) d;
include
include
#include <iostream.h> using namespace std; int main() { final int i=10; static int y=20; }
int a = 10; a > 5? cout << "true" : cout << "false"
int a,b,c; // variables declaration using comma operator a=b++, c++; // a = c++ will be done.
cout << sizeOf(double); //Will print size of double int x = 2; int i = sizeOf x;
typedef existing_name alias_name
typedef unsigned long ulong;
ulong i, j;
int* x, y ;
typedef int* IntPtr ; IntPtr x, y, z;
x is greater than y
if( expression ) { statement-block1; } else { statement-block2; }
void main( ) { int x,y; x=15; y=18; if (x > y ) { cout << "x is greater than y"; } else { cout << "y is greater than x"; } }
y is greater than x
if( expression ) { if( expression1 ) { statement-block1; } else { statement-block2; } } else
statement-block3; }
void main( ) { int a,b,c; clrscr(); cout << "enter 3 number"; cin >> a >> b >> c; if(a > b) { if( a > c) { cout << "a is greatest"; } else { cout << "c is greatest"; } } else { if( b> c) { cout << "b is greatest"; } else { printf("c is greatest"); } } getch(); }
if(expression 1) { statement-block1; } else if(expression 2) { statement-block2; } else if(expression 3 ) { statement-block3; }
variable initialization ; while (condition) { statements ; variable increment or decrement ; }
for(initialization; condition ; increment/decrement) { statement-block; }
for(initialization; condition; increment/decrement) { for(initialization; condition; increment/decrement) { statement ; } }
do { .... .....