Skip to content

Instantly share code, notes, and snippets.

View CalebCurry's full-sized avatar
💭
it's complicated

Caleb Curry CalebCurry

💭
it's complicated
View GitHub Profile
/* Getting started with linux.
Figure out what directory you're in:
- pwd
List content of current directory. Think "List":
- ls
Get more information with a flag. Think "List Long":
- ls -l
/*
C Programming is a compiled language
This means that all syntax has to be legal in order to create an executable file
C is one of the oldest languages still used today
Inspired numerous other languages (C++, C#, Java, etc)
C is not object oriented
C is statically typed (all variables are given a type at compile time)
C is not forgiving - Simple mistakes are not told to you
C is dangerous but helps you learn the details and behind the scenes
C is valuable - Still in demand, foundational concepts help everyone
if(isPrime)
{
//do something…
}
//remember to #include <stdbool.h>
bool isPrime = true;
int i;
for(i = 2; i < input; i++)
int input = 25;
for(; input >= 2; input--)
{
//figure out if number is prime here.
#include <stdio.h>
int main()
{
int i, j;
for(; i >= 0; i = i - 2)
{
printf("%i\n", i);
}
int i;
printf("Count down from: ");
scanf("%i", &i);
for(; i >= 0; i = i - 2)
int i;
printf("Count down (including 0) from: ");
scanf("%i", &i);
for(; i >= 0; i--)
for(int i = 0; i < 10; i++)
{
printf("%i\n", i);
}