What is the output statement in C language?

Release: 2020-04-16 10:57:45
Original
9500 people have browsed it

What is the output statement in C language?

#The output statement in C language is the printf function. The printf function is called the format output function, and its function prototype is in the header file "stdio.h".

The general form of the printf function call is:

printf(“格式控制字符串”, 输出表列)
Copy after login

The printf function double quotes include three characters:

(1) Format control characters starting with %

(2) Escape characters starting with \

(3) Ordinary characters

Example:

/*基础篇 2_1:printf的使用*/
#include <stdio.h>
main()
{
    int a;        //整型            %d
    long b;        //长整型        %d 
    float c;    //浮点型        %f
    double d;    //双精度浮点型    %lf

    a = 500;
    b = 14758968;
    c = 3.1;
    d = 2.5E10;

    printf("%d\n", a);
    printf("%d\n", b);
    printf("%f\n", c);
    printf("%lf\n", d);

    getchar();
}
Copy after login

Recommended: "c language tutorial

The above is the detailed content of What is the output statement in C language?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template