This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(isPrime) | |
{ | |
//do something… | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//remember to #include <stdbool.h> | |
bool isPrime = true; | |
int i; | |
for(i = 2; i < input; i++) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int input = 25; | |
for(; input >= 2; input--) | |
{ | |
//figure out if number is prime here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
int i, j; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for(; i >= 0; i = i - 2) | |
{ | |
printf("%i\n", i); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int i; | |
printf("Count down from: "); | |
scanf("%i", &i); | |
for(; i >= 0; i = i - 2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int i; | |
printf("Count down (including 0) from: "); | |
scanf("%i", &i); | |
for(; i >= 0; i--) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for(int i = 0; i < 10; i++) | |
{ | |
printf("%i\n", i); | |
} |