Search
 
SCRIPT & CODE EXAMPLE
 

C

preprocessors in c#

Directive		Description
#if				#elif
#else			#endif
If				Else if
Else			End if
#define			Symbol define
#undef			Symbol undefine
#error			Generate error
#warning		Generate warning
#line			Set line number
#region			Mark section start
#endregion		Mark section end
Comment

C #define preprocessor

#include <stdio.h>
#define PI 3.1415

int main()
{
    float radius, area;
    printf("Enter the radius: ");
    scanf("%f", &radius);

    // Notice, the use of PI
    area = PI*radius*radius;

    printf("Area=%.2f",area);
    return 0;
}
Comment

C #define preprocessor

#include <stdio.h>
#define PI 3.1415
#define circleArea(r) (PI*r*r)

int main() {
    float radius, area;

    printf("Enter the radius: ");
    scanf("%f", &radius);
    area = circleArea(radius);
    printf("Area = %.2f", area);

    return 0;
}
Comment

PREVIOUS NEXT
Code Example
C :: change no_turbo 
C :: libraries that are not supported by null sound safety in flutter 
C :: program to merge two strings in c 
C :: escaping characters in hibernate queries 
C :: golang inline function definition 
C :: l/O Multiple Values 
C :: iulia vântur 
C :: Trasmettere variabile float attraverso seriale 
C :: np mean 2nd dimension 
C :: c static variable 
C :: snprintf with malloc 
C :: Dividing canvas in live2d 
C :: nosql injection 
C :: how to write a hello world program in c 
C :: time random c 
C :: jframe mittig positionieren 
Dart :: dart regex for email 
Dart :: clickable container flutter 
Dart :: how to give shape to card in flutter 
Dart :: flutter text color 
Dart :: waiting for another flutter command to release the startup lock 
Dart :: put container in bottom column flutter 
Dart :: dart find element in list 
Dart :: dart to double 
Dart :: string to double fultter 
Dart :: inr symbol in flutter 
Dart :: flutter delay a function 
Dart :: looping through a list dart 
Dart :: dart date add day 
Dart :: dart variable in string 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =