Problem Description
Find biggest value in the array using pointers in CCODING ARENA
#include <stdio.h>
int main()
{
int a[50],s,i,l;
scanf("%d",&s);
for(i=0;i<s;i++)
scanf("%d",&a[i]);
l=a[0];
for(i=1;i<s;i++)
{
if(l<a[i])
l=a[i];
}
printf("%d",l);
return 0;
}
Test Case 1
Input (stdin)2 58 98
Expected Output98
Test Case 2
Input (stdin)3 100 80 10
Expected Output100
No comments:
Post a Comment