Search
 
SCRIPT & CODE EXAMPLE
 

CPP

c++ elif

//INCLUDING BUILT-IN LIBRARIES...
#include <iostream>
#include <stdlib.h>
//PRE-DEFINE CONSTANT VALUES...
#define MAXNUM -12    //defining an integer
#define PI 3.1415     //defining a float
#define END "

		Program has ended!!
"   //defining a string
//PRE-DEFINING CONSTANT OPERATIONS...
#define ADD(a, b, c) (a + b + c)    //Operation that will add its 3 parameters

using namespace std;

int main(){
    //using other definitions to check if the current device is Windows or UNIX
    #ifdef _WIN32  
        cout<<"Windows Operating System Detected"<<endl;
    #elif __unix__
        cout<<"UNIX Operating System Detected"<<endl;
    #else
        cout<<"Operating System could NOT be identified!"<<endl;
    #endif
    
    cout<<endl<<"Using pre-defined values and operations: "<<endl;
    cout<<" • MAXNUM: "<<MAXNUM<<endl;       //using pre-defined integer
    cout<<" • PI: "<<PI<<endl;               //using pre-defined float
    cout<<" • ADD(): "<<ADD(2,5,99.5)<<endl;   //using pre-defined function

    cout<<END;    //using pre-defined string
    return 0;
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: SUMOFPROD2 codechef solution 
Cpp :: ++ how to write quotation mark in a string 
Cpp :: print hello world c++ 
Cpp :: attention nlp 
Cpp :: c++ write to csv file append 
Cpp :: vector of vectors of pairs c++ 
Cpp :: c for loop decrement 
Cpp :: cpp template 
Cpp :: Subarray with given sum in c++ 
Cpp :: read string with spaces in c++ 
Cpp :: Traversing a C++ Array 
Cpp :: tuple vector c++ 
Cpp :: data types in c++ 
Cpp :: take a function as an argument in c++ 
Cpp :: how to make dictionary of numbers in c++ 
Cpp :: c++ fill two dimensional array 
Cpp :: create new node in tree 
Cpp :: C++ program to sizes of data types 
Cpp :: how to declare a 2d vector stack 
Cpp :: vector::at() || Finding element with given position using vector in C++ 
Cpp :: intersection between vector c++ 
Cpp :: declare a tab c++ 
Cpp :: namespace file linking c++ 
Cpp :: size of unordered_set 
Cpp :: select elements from array C++ 
Cpp :: priority queue in cpp 
Cpp :: build a prefix array cpp 
Cpp :: malloc 2d array cpp 
Cpp :: c++ segmentation fault 
Cpp :: cpp serial print override always in same place 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =