Syntax

C Print Formatted Output Syntax

In C, print formatted output: prints formatted text — printf("%d %s\n", n, name);

Quick Answer

Syntax
printf("%d %s\n", n, name);
CSyntax

Print Formatted Output

Code example
printf("%d %s\n", n, name);

Prints formatted text.

Learn More

How to print formatted output in C

  1. Open your C file or editor.
  2. Copy the example, then replace its sample names and values for your code.

C Print Formatted Output Syntax

Use printf("%d %s\n", n, name);.

Related Syntax References

Frequently asked questions

What is the C syntax for print formatted output?

Use this pattern: printf("%d %s\n", n, name);

Can I copy this C code example?

Yes. Use Copy code and adapt the example to your program.

Is this C syntax different on Mac or Windows?

No. The language syntax is the same across operating systems.

Official source · How we verify