olum marqulate
last year
Olumcountry asked

What is the function of curly braces {}?

Kelish Rai
Expert
last year
Kelish Rai answered

In C programming, curly braces { } are used to define the body of functions, conditional statements, and other code blocks.

Take a look at this simple program that prints "Hello, World!":

#include 

int main() {

    printf("Hello, World!");

    return 0;
}

In this example, the curly braces define the body of the main() function, where the actual code is executed.

If you're just starting out, I recommend you keep going through the course. It'll help you learn each concept step by step and build a solid foundation.

Hope this helps. If you need more clarification, feel free to ask. I'm happy to help.

C
This question was asked as part of the Learn C Programming course.