-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprogram4_4.c
71 lines (51 loc) · 1.06 KB
/
program4_4.c
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//4.Write a Program which accept three number and print multiplication.
#include<stdio.h>
int Multiply(int iNo1,int iNo2,int iNo3 )
{
int iMult = 0;
if(iNo1 == 0 && iNo2 == 0 && iNo3 == 0)
{
printf("0");
}
else if( iNo1==0 && iNo2 == 0)
{
iMult = iNo3;
}
else if( iNo1 == 0 && iNo3 == 0)
{
iMult = iNo2;
}
else if( iNo2 == 0 && iNo3 == 0)
{
iMult = iNo1 ;
}
else if( iNo1==0)
{
iMult = iNo2 * iNo3;
}
else if( iNo2 == 0)
{
iMult = iNo1 * iNo3;
}
else if( iNo3 == 0)
{
iMult = iNo1 * iNo1;
}
else
{
iMult = iNo1 * iNo2 * iNo3;
}
return iMult;
}
int main()
{
int iValue1 = 0;
int iValue2 = 0;
int iValue3 = 0;
int iRet = 0;
printf("Please Enter three Numbers ");
scanf("%d %d %d",&iValue1, &iValue2, &iValue3);
iRet = Multiply(iValue1,iValue2,iValue3);
printf("%d",iRet);
return 0;
}