print max val c

Solutions on MaxInterview for print max val c by the best coders in the world

showing results for - "print max val c"
Nell
24 Jan 2018
1//print max value
2int currVal;
3int maxNum;
4scanf("%d", &currVal);
5maxNum = currVal;
6
7   while (currVal > 0)
8  {
9      if (currVal > maxNum) {
10         maxNum = currVal;
11      }
12      scanf("%d", &currVal);
13   }
14printf("Max val: %d", maxNum);