Created
February 20, 2017 01:25
-
-
Save steven-barkley/2699308920cd5b081848f868e05fce6f to your computer and use it in GitHub Desktop.
argv0.c practice
This file contains 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 <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