i thnk i got the code..tis as follows...thanks anyways
#include<stdio.h>
#include<conio.h>
int main(void)
{
int node_deg[4][4];
int node_link[4][4];
int i,j,max,max_node;
printf("enter the nodal degrees for each node");
for(i=0;i<4;i++)
for(j=0;j<4;j++)
scanf("%d",&node_deg[i][j]);
printf("the nodal degrees you entered\t");
for(i=0;i<4;i++)
{
printf("\n");
printf("Node%d:\t",i);
for(j=0;j<4;j++)
{
printf("%d\t",node_deg[i][j]);
}
}
printf("\nenter the nodal links for each node");
for(i=0;i<4;i++)
for(j=0;j<4;j++)
scanf("%d",&node_link[i][j]);
printf("the nodal links you entered\t");
for(i=0;i<4;i++)
{
printf("\n");
printf("Node%d:\t",i);
for(j=0;j<4;j++)
{
printf("%d\t",node_link[i][j]);
}
}
//printf("the maximum nodal degree is%d ",max);
max=0;
max_node=0;
for(i=0;i<4;i++)
{
for(j=0;j<4;j++)
{
if(max<node_deg[i][j])
{
max=node_deg[i][j];
max_node=i;
}
}
//printf("the maximum nodal degree is%d ",max);
}
printf("\nthe node with the highest degree is::%d having degree::%d",max_node,max);
//printf("the maximum nodal degree is::%d ",max);
getch();
return 0;
}
|