Online Compiler C

#include <stdio.h> int main() { int a,b,c,d,max; scanf("%d",&a); b=a/100; c=(a%100)/10; d=a-(b*100+c*10); max=b if(c>max) max=c; if(d>max) max=d; printf("%d",max); return 0; }
This program reads a three-digit integer, extracts each digit (hundreds, tens, units), and prints the largest digit among them.

- There is a missing semicolon after `max=b`. Add it to fix the syntax error.
- The calculation for the units digit `d` is unnecessarily complex. Consider using the modulo operator `%` directly, similar to how you handled the tens digit.