Skip to content

Instantly share code, notes, and snippets.

@korkridake
Created November 22, 2018 15:32
Show Gist options
  • Save korkridake/dbae9a3a5488f46e45ae5dd8dac4c747 to your computer and use it in GitHub Desktop.
Save korkridake/dbae9a3a5488f46e45ae5dd8dac4c747 to your computer and use it in GitHub Desktop.
/*
Please try the C online editor here: https://repl.it/repls/CorruptPoshScriptinglanguages
*/
#include <stdio.h>
/*
How to write your first function in C Language?
Desciption:
- "main" function
- { statement } identifies the function body
- printf: print() function displays something
- return 0: always ends like this for "main" function
*/
/*
int main(void) {
printf("Hello Kyle\n");
printf("Hello Che\n");
return 0;
}
*/
/*
int main(void) {
printf("Hello Kyle");
printf("Hello Che\n");
return 0;
}
*/
int main(void) {
int x = 4;
int y = 5;
int z = x + y;
if (x > y)
{
printf("Hello Kyle\n");
printf("Hello Che\n");
}
else
{
printf("X is less than Y");
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment