To output data in C, you typically use the printf()
function from the standard input-output library (stdio.h
). Here's how you can use it:
In the printf()
function:
%d
is the format specifier for integers.%f
is the format specifier for floating-point numbers.%c
is the format specifier for characters.%.2f
specifies that the floating-point number should be displayed with two decimal places.\n
is the newline character, which moves the cursor to the beginning of the next line after printing.Remember to include the necessary header file #include <stdio.h>
at the beginning of your code to use the printf()
function.