Skip to content

Instantly share code, notes, and snippets.

@steven-barkley
Created February 20, 2017 01:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steven-barkley/2699308920cd5b081848f868e05fce6f to your computer and use it in GitHub Desktop.
Save steven-barkley/2699308920cd5b081848f868e05fce6f to your computer and use it in GitHub Desktop.
argv0.c practice
#include <cs50.h>
#include <stdio.h>
#include <string.h>
int main (int argc, string argv[])
{
if( argc != 2)
{
printf("Missing command-line arguments\n");
return 1;
}
printf("Hello, %s\n",argv[1]);
}
// int sigma (int);
// int main(void)
// {
// int n;
// do
// {
// printf("Postive integer please: ");
// n = GetInt();
// }
// while (n < 1)
// int answer = sigma(n);
// printf("%i\n", answer);
// }
// int sigma(int m)
// {
// if (m<=0)
// {
// return 0;
// }
// else
// {
// return(m +(sigma + m)
// }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment