some-usable-scripts/exemple.c

25 lines
398 B
C
Raw Normal View History

2011-02-03 13:47:29 +01:00
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int multiple(int, int);
int main( int argc, char **argv)
{
if(argc < 3)
{ perror("Usage : ./truc.out nombre nombre\n"); return 1; }
int var1 = atoi(argv[1]);
int var2 = atoi(argv[2]);
int truc = multiple(var1,var2);
printf("Mon multiple : %d %s \n", truc, "Salut !");
return 0;
}
int multiple(int a, int b)
{
return a * b;
}