-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathneg.c
More file actions
30 lines (29 loc) · 550 Bytes
/
Copy pathneg.c
File metadata and controls
30 lines (29 loc) · 550 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
#include<stdio.h>
int main()
{
int n1,n2,sum,product,pn1,pn2;
printf("Enter N1 and N2\n");
scanf("%d %d",&n1,&n2);
if(n1<0 && n2<0)
{
if(n1<n2)
{
n1=-(n1);
}
else
{
n2=-(n2);
}
product=n1*n2;
sum=n1+n2;
printf("Your sum is %d\n",sum);
printf("Your product is %d\n",product);
}
else
{
sum=n1+n2;
product=n1*n2;
printf("Your sum is %d\n",sum);
printf("Your product is %d\n",product);
}
}