This repository has been archived on 2023-10-26. You can view files and clone it, but cannot push or open issues or pull requests.
VSMechatronics/Exercises/C21/ex1.c
2023-10-26 20:24:04 +01:00

21 lines
295 B
C

#include <stdlib.h>
#include <stdio.h>
int main(int argc, char *argv[]) {
int age;
char name[10];
if ( argc != 3 )
{
printf ("USAGE: %s name age\n",argv[0]);
exit (0);
}
sscanf(argv[1],"%s",name);
sscanf(argv[2],"%d",&age);
printf ("age=%d name=%s\n", age, name);
return 0;
}