programming-examples/c/Functions/C Program to Find largest of two numbers using functions.c
2019-11-15 12:59:38 +01:00

22 lines
426 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include<stdio.h>
void main()
{
void max();
max();
}
void max()
{
int a[5],max,n,i;
printf("How many nos you want to enter: ");
scanf("%d",&n);
printf("Enter element for the array: ");
for(i=0; i<n; i++)
scanf("%d",&a[i]);
max=a[0];
for(i=1; i<5; i++)
{
if(max<a[i])
max=a[i];
}
printf("maximum no= %d",max);
}