×

C Programs

C Basic & Conditional Programs

C Looping Programs

C String Programs

C Miscellaneous Programs

C Preprocess Directive: __LINE__ Macro

By IncludeHelp Last updated : March 10, 2024

C __LINE__ Macro

The __LINE__ is an inbuilt Macro in C programming language, it returns current line number of the code.

__LINE__ Macro Example

#include <stdio.h>

int main(){
    printf("Hello world\n");
    printf("Line: %d\n",__LINE__);
    printf("How are you?\n");
    printf("Line: %d\n",__LINE__);
    printf("Bye bye!!!\n");	
    return 0;
}

Output

Hello world
Line: 6
How are you?
Line: 8
Bye bye!!!

C Preprocessors Programs »

Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.