#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
int lrc[4],vrc[4],LF=0,VF=0,temp[4][4];
int i,j,flag=0;
clrscr();
printf("\n\n\t\tPROGRAMM FOR COUNTING BIT\n\n");
for(i=1;i<=3;i++)
{
for(j=1;j<=3;j++)
{
printf("\n\t\tENTER VALUE FOR temp[%d][%d] : ",i,j);
scanf("%d",&temp[i][j]);
if(temp[i][j]==1)
{
flag++;
}
}
flag=flag%2;
if(flag==0)
{vrc[i]=0;}
else
{vrc[i]=1;}
flag=0;
}
flag=0;
for(i=1;i<=3;i++)
{
for(j=1;j<=3;j++)
{
printf(" %d ",temp[i][j]);
if(temp[j][i]==1)
{
flag++;
}
}
flag=flag%2;
if(flag==0)
{lrc[i]=0;}
else
{lrc[i]=1;}
flag=0;
printf("\n");
}
printf("\n\n\tV R C : ");
for(i=1;i<=3;i++)
{
printf(" %d ",vrc[i]);
if(vrc[i]==1)
VF++;
}
printf("\n\n\tL R C : ");
for(i=1;i<=3;i++)
{
printf(" %d ",lrc[i]);
if(lrc[i]==1)
LF++;
}
printf("LF :%d VF :%d",LF,VF);
if(LF%2==1&&VF%2==1)
{
printf("\n\n\t\tYOU HAVE SUCCESSFULLY MEASSAGE IS RECIVED..!!!");
}
else
{ printf("\n\n\t\tFAILED TO LOAD");
}
getch();
}
#include<conio.h>
#include<string.h>
void main()
{
int lrc[4],vrc[4],LF=0,VF=0,temp[4][4];
int i,j,flag=0;
clrscr();
printf("\n\n\t\tPROGRAMM FOR COUNTING BIT\n\n");
for(i=1;i<=3;i++)
{
for(j=1;j<=3;j++)
{
printf("\n\t\tENTER VALUE FOR temp[%d][%d] : ",i,j);
scanf("%d",&temp[i][j]);
if(temp[i][j]==1)
{
flag++;
}
}
flag=flag%2;
if(flag==0)
{vrc[i]=0;}
else
{vrc[i]=1;}
flag=0;
}
flag=0;
for(i=1;i<=3;i++)
{
for(j=1;j<=3;j++)
{
printf(" %d ",temp[i][j]);
if(temp[j][i]==1)
{
flag++;
}
}
flag=flag%2;
if(flag==0)
{lrc[i]=0;}
else
{lrc[i]=1;}
flag=0;
printf("\n");
}
printf("\n\n\tV R C : ");
for(i=1;i<=3;i++)
{
printf(" %d ",vrc[i]);
if(vrc[i]==1)
VF++;
}
printf("\n\n\tL R C : ");
for(i=1;i<=3;i++)
{
printf(" %d ",lrc[i]);
if(lrc[i]==1)
LF++;
}
printf("LF :%d VF :%d",LF,VF);
if(LF%2==1&&VF%2==1)
{
printf("\n\n\t\tYOU HAVE SUCCESSFULLY MEASSAGE IS RECIVED..!!!");
}
else
{ printf("\n\n\t\tFAILED TO LOAD");
}
getch();
}
No comments:
Post a Comment