_{#include "stdio.h"}

_{#include "conio.h"}

_{void main()}

_{{}

_{ int i,j;}

_{ int count2;}

_{ int m,n,a[10][10];}

_{ clrscr();}

_{printf("\n @@@ Enter the no of edge and vertice@@@ \n-> ");}

_{ scanf ("%d%d",&m,&n);}

_{ printf ("\n Enter the adjacency matrix : \n");}

_{ for (i=0;i}

_{ {}

_{ for(j=0;j}

_{ {}

_{ scanf("%d",&a[i][j]);}

_{ }}

_{ }}

total=0;

for (i=0;i

{

count=0;

for(j=0;j

{

if ( a[i][j]==1 && i!=j)

{

count=count+1;

}

else

if(i==j && a[i][j]==1)

{

count=count+2;

printf ("\n>>>vertex %d contain self loop in a graph",i+1);

}

}

printf ("\n>>>Degree of vertex %d = %d",i+1,count);

total=total+count;

if (count%2==0)

{

flag=flag+count;

}

if (count%2 == 0)

{

even++;

}

else

{

odd++;

}

}

printf ("\n>> Number of odd degree count is %d",odd);

printf ("\n>> Number of even degere count is %d",even);

printf ("\n>> Total degree is = %d",total);

_{ getch();}_{ }}

## No comments:

Write comments