#include <stdio.h>
#include <conio.h>
int main()
{
int n, i, max;
printf ("Enter Total Numbers Of Numbers In The Array: ");
scanf ("%d",&n);
int array[n];
for( i=0; i<n; i++)
{
printf ("\nEnter %d Number: ",i+1);
scanf ("%d",&array[i]);
}
max = array[0];
for(i=0;i<n;i++)
{
if(array[i] > max)
max = array[i];
}
printf ("\nThe Largest Number in the array is %d ",max);
}
#include <conio.h>
int main()
{
int n, i, max;
printf ("Enter Total Numbers Of Numbers In The Array: ");
scanf ("%d",&n);
int array[n];
for( i=0; i<n; i++)
{
printf ("\nEnter %d Number: ",i+1);
scanf ("%d",&array[i]);
}
max = array[0];
for(i=0;i<n;i++)
{
if(array[i] > max)
max = array[i];
}
printf ("\nThe Largest Number in the array is %d ",max);
}
No comments:
Post a Comment