find the largest number in a table

Solutions on MaxInterview for find the largest number in a table by the best coders in the world

showing results for - "find the largest number in a table"
Marlene
29 Oct 2016
1#include <stdio.h>
2int main(void) {
3 int i,n,m,t[50];
4printf("How long do you want your table? :");
5scanf("%d",&n);
6 for (i=0;i<n;i++){
7printf("enter the %d number :",i+1);
8scanf("%d",&t[i]);
9 }
10 m=t[0];
11 for (i=0;i<n;i++){
12   if (m<t[i])
13   m=t[i];
14    }
15printf("The largest number in this table is : %d\n",m);
16
17  return 0;
18  }