Documente Academic
Documente Profesional
Documente Cultură
ARUNKRISHNAN PP
CLASS:S7 CSE
ROLL NO :11
Interpretation
x,y – set of positive integer
H- even integer
R- even integer and have two arguments and return true if x mod y is even
VENN DIAGRAMS
8 2 2
8
16 4 4
16
32 7 7
32
X Y R
C Implementation
1. #include<stdio.h>
2. #include<math.h>
3. #include<string.h>
4. int ISEVEN(int a)
5. {
6. if(a%2==0)
7. {
8. return 0;
9. }
10.else
11.{
12.return 1;
13.}
14.}
15.int R(int k,int l)
16.{
17.int c=k%l;
18.if(c%2==0)
19.{
20.return 0;
21.}
22.else
23.{
24.return 1;
25.}
26.}
27.void main()
28.{
29.int flag=0;
30.int b,c;
31.int i,j;
32.int x[3]= {8,16,32};
33.int y[3]={2,4,7};
34.for(i=0;i<3;i++)
35.{
36.for(j=0;j<3;j++)
37.{
38.if(ISEVEN(x[i])==0&&ISEVEN(y[j])==0)
39.{
40.int v=R(x[i],y[j]);
41.if(v==0)
42.{
43.//flag=1;
44.printf("%d relation %d is TRUE LHS AND RHS satisfie \n",x[i],y[j]);
45.}
46.else
47.{
48.flag=0;
49.printf("%d relation %d is FALSE becouse RHS didnt satisfie\n",x[i],y[j]);
50.}
51.}
52.else
53.printf("%d relation %d is FALSE LHS didnt satisfie\n",x[i],y[j]);
54.}
55.}
56./*if(flag==1)
57.{
58.printf("true");
59.}
60.else
61.("false");*/
62.}
63.Output
OUTPUT
Out put are showing false case because the input given is implying false result
Input( x={8,16,32};
Y={2,4,7}; )