The __LINE__ Macro Example in C | C preprocessor programs

The __LINE__ Macro Example in C: Here, we will learn how the __LINE__ Macro works in C programming language?
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.