//INCLUDING BUILT-IN LIBRARIES...
#include <stdio.h>
#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
int main(){
//using other definitions to check if the current device is Windows or UNIX
#ifdef _WIN32
printf("
Windows Operating System Detected
");
#elif linux
printf("
UNIX Operating System Detected
");
#else
printf("
Operating System could NOT be identified!
");
#endif
printf("
Using pre-defined values and operations: ");
printf("
• MAXNUM: %d",MAXNUM); //using pre-defined integer
printf("
• PI: %f",PI); //using pre-defined float
printf("
• ADD(): %.2f",ADD(2,5,99.5)); //using pre-defined function
printf(END); //using pre-defined string
return 0;
}
Code Example |
---|
Cpp :: Find the biggest element in the array |
Cpp :: iterate over map c++ |
Cpp :: power of a number |
Cpp :: doubly linked list in cpp |
Cpp :: copying a set to vector in c++ |
Cpp :: insertion sort cpp |
Cpp :: c++ operator overloading |
Cpp :: zero fill in c++ |
Cpp :: c++ compile to exe |
Cpp :: matrix dynamic memory c++ |
Cpp :: define in cpp |
Cpp :: hello c++ |
Cpp :: cpp define function |
Cpp :: transformer in nlp |
Cpp :: char to string c++ |
Cpp :: structure of a function in C++ |
Cpp :: define vector with size and value c++ |
Cpp :: c++ print |
Cpp :: visual studio cpp compiler |
Cpp :: add matic mainnet to metamask mobile |
Cpp :: how to get euler constant in c++ |
Cpp :: print Colored text in C++ |
Cpp :: c++ multiply char |
Cpp :: C++ if...else...else if |
Cpp :: Euler constant |
Cpp :: vectors in c++ |
Cpp :: int cpp |
Cpp :: c++ if else example |
Cpp :: sum of n natural numbers |
Cpp :: Valid Parentheses leetcode in c++ |