-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathops.c
More file actions
40 lines (28 loc) · 917 Bytes
/
Copy pathops.c
File metadata and controls
40 lines (28 loc) · 917 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
35
36
37
38
39
40
# include <stdio.h>
int main(){
// C OPERATORS
/*int a;
int b;
printf("Enter two numbers;");
scanf("%d %d",&a,&b);
printf("Answer=%d",a+b);
Alternatively
int result;
result=a+b;
printf("Answer=%d",result);
double num1;
double num2;
printf("Enter two numbers:");
scanf("%lf %lf",&num1,&num2);
printf("%.2lf * %.2lf=%.2lf \n",num1,num2,num1*num2); // product
printf("%.2lf + %.2lf=%.2lf \n",num1,num2,num1+num2);//sum
printf("%.2lf - %.2lf=%.2lf \n",num1,num2,num1-num2);//subtraction
printf("%.2lf / %.2lf=%.2lf \n",num1,num2,num1/num2);// quotiant
printf (" The increment ++ =%.2lf and %.2lf \n",++num1,++num2); // increment
printf("The decrement -- =%.2lf and %.2lf",--num1,--num2);// decrement
////// The modulas or the remainder operator only works with integers */
//// A Quiz to test precedence
int x=5+2*9/3-3;
printf("5+2*9/3-3=%d",x);
return 0;
}