-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogram6.c
More file actions
61 lines (61 loc) · 1.23 KB
/
program6.c
File metadata and controls
61 lines (61 loc) · 1.23 KB
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
#include <stdio.h>
int main()
{
char b[4],a[9]; int r;
printf("enter the dividend : "); scanf("%s",&a);
printf("enter the divisior : "); scanf("%s",&b);
printf("\n");
for(int k=0;k<9;k++)
{
if(a[k]!='0')
{
r=0;
while(r!=4)
{
if(a[k+r]=='0' && b[r]=='0')
{
a[k+r]='0';
}
else if(a[k+r]=='1' && b[r]=='1')
{
a[k+r]='0';
}
else
{
a[k+r]='1';
}
r=r+1;
}
}
else
{
r=0;
if(a[k+r]=='0')
{
a[k+r]='0';
}
else
{
a[k+r]='1';
}
r=r+1;
}
if(k==6)
{
break;
}
}
int count=0;
for(int t=6;t<9;t++)
{
printf("%c ",a[t]);
if(a[t]=='0')
{
count=count+1;
}
}
if(count==3)
printf("\nthere are no errors so accept the data\n");
else
printf("\nthere is a error so reject the data\n");
}