Skip to content

Instantly share code, notes, and snippets.

@vijayanandrp
Created June 14, 2017 21:07
Show Gist options
  • Save vijayanandrp/5e4d114927c10cd8ad15954d64bad8d2 to your computer and use it in GitHub Desktop.
Save vijayanandrp/5e4d114927c10cd8ad15954d64bad8d2 to your computer and use it in GitHub Desktop.
Simple C Program
#include<stdio.h>
#include<conio.h>
int main(int argc, char *argv[])
{
if (argc < 2)
{
printf("%s \n", "Pass your name as the argument");
return 0;
}
else
{
printf("Hello %s \n", argv[1]);
return 1;
}
}
/*
After long years now enjoying my C language :)
$ gcc cprogram.c -o cprogram
$ chmod u+x cprogram
$ ./cprogram "Vijay Anand"
$ Hello Vijay Anand
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment