Skip to main content
saved 1 byte
Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670

C (gcc), 9998 bytes

-1 thanks to ceilingcat

Adapted from my JS answer. Prints the bounds separated by a space.

m,M,x,p;f(n){for(M=n*n,m=1,x=p=2;m=(x*=p)>n|x<m?m:x,x<n?1:x<M?M=x:(x=++p)<n;);printf("%d %d",m,M);} 

Try it online!Try it online!

C (gcc), 99 bytes

Adapted from my JS answer. Prints the bounds separated by a space.

m,M,x,p;f(n){for(M=n*n,m=1,x=p=2;m=(x*=p)>n|x<m?m:x,x<n?1:x<M?M=x:(x=++p)<n;);printf("%d %d",m,M);} 

Try it online!

C (gcc), 98 bytes

-1 thanks to ceilingcat

Adapted from my JS answer. Prints the bounds separated by a space.

m,M,x,p;f(n){for(M=n*n,m=1,x=p=2;m=(x*=p)>n|x<m?m:x,x<n?:x<M?M=x:(x=++p)<n;);printf("%d %d",m,M);} 

Try it online!

Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670

C (gcc), 99 bytes

Adapted from my JS answer. Prints the bounds separated by a space.

m,M,x,p;f(n){for(M=n*n,m=1,x=p=2;m=(x*=p)>n|x<m?m:x,x<n?1:x<M?M=x:(x=++p)<n;);printf("%d %d",m,M);} 

Try it online!