Copy C Code & Paste it below the Compiler & Run

11. Global variables

#include <stdio.h>
int a = 1;
int b = 2;
int main() {
    printf("&a = %p  &b = %p\n", &a, &b);
    printf("a = %d\n", a);
    a += 1;
    printf("a = %d\n", a);
}

12. Hello World

#include <stdio.h>
int main() {
   printf("hello, ");
   printf("world! %i\n", (2 + 4) * 7);
}

13. Initialization lists

#include <stdio.h>
int main() {
    int a[] = {1, 2};
    int * b = a;
    printf("%d %d\n", *b, b[1]);
    return 0;
}

9. Input/output

#include <stdio.h>
unsigned long strlen(const char * s) {
  unsigned long l = 0;
  while (*s++) ++l;
  return l;
}
int main() {
    int a, n;
    char s[12];
    printf("Enter a word and a number:\n");
    n = scanf("%s %d", s, &a);
    if (n == 2) {
        printf("word length * number value = %lu\n", strlen(s) * a);
    } else {
        printf("missing value!\n");
    }
    return 0;
}

15. int, short, char

#include <stdio.h>
int main() {
  char c = '*', d = 127;
  unsigned char e = d + 1;
  int i = c, j = 0x1002A;
  short  s = j;
  printf("%i %i %i %u\n", i, j, s, e);
}