This language bar is your friend. Select your favorite languages!
Edit summary for version 20 :

Version 19

Version 20

Idiom #59 Write to standard error stream

Print the message "x is negative" to standard error (stderr), with integer x value substitution (e.g. "-2 is negative").

Idiom #59 Write to standard error stream

Print the message "x is negative" to standard error (stderr), with integer x value substitution (e.g. "-2 is negative").

Imports
import System.IO (hPutStrLn, stderr)
Imports
import System.IO (hPutStrLn, stderr)
Code
hPutStrLn stderr (show (x) ++ " is negative")
Code
hPutStrLn stderr (show (x) ++ " is negative")
Imports
#include <stdio.h>
Imports
#include <stdio.h>
Code
fprintf(stderr,"%d is negative\n",x);
Code
fprintf(stderr,"%d is negative\n",x);
Code
System.err.format("%d is negative\n",x);
Code
System.err.format("%d is negative\n",x);
Demo URL
https://ideone.com/aiFVno
Demo URL
https://ideone.com/aiFVno
Imports
import "os"
Imports
import "os"
Code
fmt.Fprintln(os.Stderr, x, "is negative")
Code
fmt.Fprintln(os.Stderr, x, "is negative")
Demo URL
https://play.golang.org/p/6x6amJrySS
Demo URL
https://play.golang.org/p/6x6amJrySS