Sunday, December 14, 2008

Find the Maximum value in a Array

#include

void main()

{

int i,count=0,max,x;
int str[10];

for(i=0;i<3;i++)
{
printf("enter:");
scanf("%d",&str[i]);
}

max=str[0];

for(x=0;x<3;x++)
{
if(max < str[x] )
max=str[x];
}
printf("Vaval is:%d",max);

}

0 comments: