programming c code example

Example 1: c

/* Answer to: "c" */

/*
  To learn about the letter 'C' you go to the Wikipedia:
  https://en.wikipedia.org/wiki/C
  ...but this is a Chrome Exstention for developers:

  C is a general-purpose, procedural computer programming language
  supporting structured programming, lexical variable scope, and
  recursion, while a static type system prevents unintended
  operations.
  
  Here's the Wikipedia:
  https://en.wikipedia.org/wiki/C_(programming_language)
*/

Example 2: c

#include <stdio.h>

int main() {
   printf("Hello, world!");
   return 0;
}

Example 3: c programming language

// this is a single-line comment
/*
this is a multi-line comment!
*/

#include <stdio.h> // this library is included for i/o
#include <stdlib.h> // this library is included for some handy functions

// This function will be ran when the program executes
int main() {
 
  printf("Hello, world!\n"); // this prints "Hello, world!" [line break]
  
  char* myString = "An awesome string!"; // declare string variable!
  printf("%s\n", myString); // print myString where %s is
  
  int myInt = 10;
  printf("%d\n", myInt); // print myInt where %d is
  
  double myDouble = 5.2; // declare double (decimal) variable!
  printf("%f\n", myDouble); // print myDouble where %f is
  
  return 0; // < exit out of the program
}