Newer
Older
/* Adds up 2 integers, not the most exciting thing in the world */
#include <stdio.h>
int
main (int argc, char **argv)
{
int a, b;
if (argc != 3)
{
printf ("Please input an integer value: ");
scanf ("%d", &a);
printf ("Please input an integer value: ");
scanf ("%d", &b);
}
else
{
sscanf (argv[1], "%d", &a);
sscanf (argv[2], "%d", &b);
}
printf ("%d + %d = %d\n", a, b, a + b);
return 0;
}