Computer Science & C Programming


Programs = Algorithms in a specific language

  1. Instructions are used in (sub)programs definitions
  2. There always exists a main program defined as follow
void main() {
   // instructions here
}

Nb. // correspond to a comment.
3. The code is saved in a file having a .c extension
4. Sub-programs (e.g printf) are organized into libraries (e.g. stdio.h) that can be included at the top of the preceding file


#include <stdio.h> // STandarD Inputs-Outputs library

void main() {
   printf("%c",'a' ); // "printf" is a subprogram that puts data into screen location
   printf("%i",97  );
   printf("%f",3.14);
}

source


14 - 15