What is printf in c programming

Welcome to this article and this article is all about what is c printf in c programming and how to use printf in the c program.

In c programming there are two types of functions are available, one is a predefined function and another is a user-defined function. So print is a kind of predefined function.

Printf is not a keyword. Mainly this is a keyword that is used to display anything. And functions are stored in the c language library.

we can use these functions according to our requirements.

Syntax:

main()

{

Printf(“ ”);

}

This is a perfect syntax of printf function, we normally write the printf function within the main function. And which consists of parentheses and we normally end the function with a semicolon.

If you don’t understand the c program syntax then I would suggest you please read our previous article about how to declare the c program.

Example:

main()

{

printf(“write something”);

}

If we compile this program then write something will be displayed but if you are using the turbo compiler then you have to definitely write getch() function which is an input instruction, which means to take one character from your keyboard.

In this method, we can display anything we want. But if you want to display your name in separate lines then you have to take the help of escape sequences.

Example:

main()

{

printf(“write\n”);

printf(“something”);

}

In this program, we take the help of an escape sequence which actually means bringing our cursor into the next line. And in output write will display in the first line and something will be displayed in the

next lines.

In c language there are many types of escape sequences are available and we will discuss all the escape sequences in the next articles.

Conclusion:

In this article, we discussed what is printf in c programming and how to use this function in c programming.

If you eager to learn about the other programming languages such as – java, javascript, python then please follow our website.

Because on this website we provide detailed guidance about the various programming languages.