Created
May 11, 2012 16:02
-
-
Save ff6347/2660633 to your computer and use it in GitHub Desktop.
a mini example c program
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 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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This Gist is part of MT4D coming soon on fabiantheblind.info