Programmer Coding

First C Program

Header record Inclusion:

#include <stdio.h>:  This line consists of the same old input-output library (stdio.h). This library provides features like printf() and scanf() for input and output operations.

predominant feature:

int main() { … }: the principle() characteristic is the entry factor of the C software. it is in which the execution of the program begins. In this situation, the principle() characteristic takes no arguments and returns an integer (int) price.

Print announcement:

printf(“programmer__coding”);: This line makes use of the printf() feature to print the string “whats up c programming language” to the usual output (generally the console).

return declaration:

return 0;: The return announcement exits the main() characteristic and returns an integer value to the calling surroundings (normally the working machine). A return price of 0 typically indicates a hit execution of this system.

This application, when compiled and done, will print “hiya c program languageperiod” to the console. It serves as a easy demonstration of a way to write and execute a primary C program.

 

To compile and run the program

 

Open a textual content editor and copy the provided code into a new file, for example, first_program.c.

keep the report.

Open a terminal or command prompt.

Navigate to the directory wherein the document is stored.

collect the program the use of a C compiler. for example, if the use of GCC, you can type gcc first_program.c -o first_program.

Run the compiled application by using typing ./first_program.

The output “whats up c language” ought to be displayed on the console.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top