Curriculum
Course: C basic
Login

Curriculum

C basic

C Introduction

0/1

C Get Started

0/1

C Comments

0/1

C Constants

0/1

C Operators

0/1

C Break and Continue

0/1

C User Input

0/1

C Memory Address

0/1

C Structures

0/1
Text lesson

Print Text

Output (Print Text)

In C, you utilize the printf() function to display values or output text.

Example

#include <stdio.h>

int main() {
  printf(“Hello World!”);
  return 0;
}

Double Quotes

Text must be enclosed within double quotation marks “” when working with it.

Forgetting the double quotes leads to an error.

Example

printf(“This sentence will work!”);

 

printf(This sentence will produce an error.);

Many printf Functions

You’re free to use printf() functions as needed, but it’s important to remember that it doesn’t automatically insert a new line at the end of the output.

Example

#include <stdio.h>

int main() {
  printf(“Hello World!”);
  printf(“I am learning C.”);
  printf(“And it is awesome!”);
  return 0;
}