Skip to content

Instantly share code, notes, and snippets.

@ff6347
Created May 11, 2012 16:02
Show Gist options
  • Save ff6347/2660633 to your computer and use it in GitHub Desktop.
Save ff6347/2660633 to your computer and use it in GitHub Desktop.
a mini example c program
// include the io lib
#include<stdio.h>
// the compare function takes integer as arguments
int compare(int a, int b){
if(a>b){return a;}else{return b;}
}
// the main function
int main(void){
char name[11] = "Hello World"; // our string
int a = 23,b = 5; // the values to compare
// now print all that stuff
// with %s you insert string arguments
// with %d digits
printf("The Object named: %s\nCompared: %d with %d.\n%d is bigger!",name,a,b,compare(a,b));
return 0;// everything went fine return 0
}
@ff6347
Copy link
Author

ff6347 commented May 11, 2012

This Gist is part of MT4D coming soon on fabiantheblind.info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment