MAE 3185 - Introduction to Mechatronics

Logo

View the Project on GitHub Abhiricky1992/UTA-MAE3185-Notes

Program Structure

Before we study the basic building blocks of the C programming language, let us look at a bare minimum C program structure so that we can take it as a reference in the upcoming chapters.

Hello World Example

A C program basically consists of the following parts,

Let us look at a simple code that would print the words “Hello World”,

#include <stdio.h>

int main()
{
   /* my first program in C */
   printf("Hello, World!\n");
   
   return 0;
}

Let us take a look at the various parts of the above program,

Next

Basic Syntax

Back

Back to Chapter 1