-
Notifications
You must be signed in to change notification settings - Fork 486
Expand file tree
/
Copy path3-mul.c
More file actions
34 lines (28 loc) · 627 Bytes
/
3-mul.c
File metadata and controls
34 lines (28 loc) · 627 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
* File: 3-mul.c
* Auth: Brennan D Baraban
*/
#include <stdio.h>
#include <stdlib.h>
/**
* main - Prints the multiplication of two numbers, followed by a new line.
* @argc: The number of arguments supplied to the program.
* @argv: An array of pointers to the arguments.
*
* Return: If the program receives two arguments - 0.
* If the program does not receive two arguments - 1.
*/
int main(int argc, char *argv[])
{
int num1, num2, prod;
if (argc != 3)
{
printf("Error\n");
return (1);
}
num1 = atoi(argv[1]);
num2 = atoi(argv[2]);
prod = num1 * num2;
printf("%d\n", prod);
return (0);
}