Skip to content

Commit d7d34a5

Browse files
modified: 6_operators.c
new file: 6_operators.exe new file: 7_operator_precedence.c new file: 8.exe new file: 8_P1_multiplication_table.c
1 parent 66f14ff commit d7d34a5

5 files changed

+77
-0
lines changed

6_operators.c

+46
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#include <stdio.h>
22

33
int main(void){
4+
// Binary operators :
5+
int a,b;
6+
a = 2;
7+
b = 3;
8+
printf("%d",a&b);
49

510
}
611

@@ -13,4 +18,45 @@ OPERATORS : Symbol which make 2 operands one
1318
1419
// Logical operatos && , || , !
1520
21+
// Assignment operator += , -=, *= , /=, =
22+
23+
// Bitwise operators :
24+
25+
>> & and
26+
27+
(2)&(3) = (10)&(11) = (10) = (2)
28+
29+
like this 10
30+
& 11
31+
----
32+
10
33+
34+
>> | or
35+
36+
(2)|(3) = (10)|(11) = (11) = (3)
37+
38+
>> ^ exclusive or
39+
40+
(2)^(3) = (10)^(11) = (01) = (1)
41+
42+
// Miscellanous operators :
43+
44+
>> sizeof(a)
45+
46+
a ki value se koi matlab nhi , a ke datatype se matlab hai
47+
a ke datatype ki range in bytes bta dega present artitecture ke hisab se
48+
49+
>> &(a)
50+
51+
returns address of a
52+
53+
>> *(a)
54+
55+
returns pointer of a
56+
57+
>> ?:
58+
59+
like Js, if else in one statement
60+
61+
>>
1662
*/

6_operators.exe

30.5 KB
Binary file not shown.

7_operator_precedence.c

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#include <stdio.h>
2+
3+
int main(int argc, char const *argv[])
4+
{
5+
6+
return 0;
7+
}
8+
9+
/*
10+
Operation precedence
11+
12+
*,/ (>) +,-
13+
14+
but in * (vs) / it goes left to right
15+
but in + (vs) - it goes left to right
16+
17+
*/

8.exe

30.6 KB
Binary file not shown.

8_P1_multiplication_table.c

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#include <stdio.h>
2+
3+
int main(void)
4+
{
5+
int n;
6+
printf("Enter the number\n");
7+
scanf("%d",&n);
8+
9+
for (size_t i = 1; i <= 10 ; i++)
10+
{
11+
printf("%d x %d = %d\n",n,i,n*i);
12+
}
13+
return 0;
14+
}

0 commit comments

Comments
 (0)